VMware Cloud Community
rxjoseph
Enthusiast
Enthusiast
Jump to solution

Powercli Get-VM is not listing only SRM VM

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

 

 

 

 

 

 

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Are you connected to both vCenters?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

Are you connected to both vCenters?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

rxjoseph
Enthusiast
Enthusiast
Jump to solution

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 

 

 

0 Kudos