Automation

 View Only
  • 1.  Powercli Get-VM is not listing only SRM VM

    Posted Mar 22, 2021 05:49 PM

    Hi Experts

    I am writing a script to list all SRM VMs i.e the ones which are powered on and the Placeholders

    Example 

    As you can see from my vCenter search i can list the SRM protected VM and its Placeholder VM

    rxjoseph_0-1616434931717.png

    However in Powercli if I do a Get-VM I get only the Placeholder VM

    rxjoseph_1-1616435000121.png

    I have thousands of VMs where its SRM protected and in GUI i can see both VMs but in Powercli just the one which is the placeholder VM

    Also I tried the following queries

    Get-VM TestVM_CLU106 | Where-Object {$_.ExtensionData.Config.ManagedBy.ExtensionKey -ne 'com.vmware.vcDr'}

    I still get no answer 

    Please advise

     

    Many thanks

    RXJ

     

     

     

     

     

     



  • 2.  RE: Powercli Get-VM is not listing only SRM VM
    Best Answer

    Posted Mar 22, 2021 06:30 PM

    Are you connected to both vCenters?



  • 3.  RE: Powercli Get-VM is not listing only SRM VM

    Posted Mar 23, 2021 09:11 AM

    Thank you so much LucD, yes that was the reason, we have 14 vCenters and I didn't connect to the correct vCenter 

    You are a star as always. Thanks again