3 Replies Latest reply on Jul 7, 2020 4:17 AM by winsolo

    Unprotect a VM using UnprotectVms(VMware.Vim.ManagedObjectReference[] vms) Method

    winsolo Novice

      Is there a way to call these methods to unprotect and unassociate a particular VM from a protection group?




      I was looking at one of the old blogs about it in PowerCLI 5.5 R2 and the Site Recovery Manager API - VMware vSphere Blog and wasn't able to construct a way to unprotect VM from a group, although I was just able to get all the VMs with their protection groups associated with.



      $SrmApi = $SrmConnection.ExtensionData

      $ProtectionGroups = $SrmApi.Protection.ListProtectionGroups()

      foreach($PG in $ProtectionGroups) {

          $PG.ListProtectedVMs() | Select @{N='ProtectionGroup';E={($PG.GetInfo().Name)}},VmName,State,PeerState