VMware vSphere PowerCLI provides a Windows Powershell interface to the VMware vSphere and vCloud and the SRM APIs. VMware vSphere PowerCLI includes numerous cmdlets, sample scripts, and a function library. PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 400 cmdlets for managing and automating vSphere and vCloud.
This release of vSphere PowerCLI introduces a number of new capabilities and expands on the existing cmdlets introducing cmdlets for vCenter Site Recovery Manager and providing further management of the VMware vSphere and VMware vCloud Director products.
Using the Connect-SRMServer and Disconnect-SRMServer you are now able to connect to vCenter SRM and access all public APIs available, use of the $global:DefaultSrmServers object properties and methods after connection allow for access to recovery group and protection group automation.
Sample Scripts for Managing vCenter Site Recovery Manager with VMware vSphere PowerCLI
- Protect a Virtual Machine - You can protect a virtual machine by replicating it to a remote SRM site.
- Connect-SrmServer - This cmdlet establishes a connection to a vCenter Site Recovery Manager (SRM) server.
- Create a Report of the Virtual Machines Associated with All Protection Groups - You can create a simple report containing information about the virtual machines associated with all protection groups.
- Create a Report of the Protected Virtual Machines - You can create a simple report containing information about the protected virtual machines associated with an SRM server.