VMware Cloud Community
scotty_p
Enthusiast
Enthusiast
Jump to solution

Find vCenter a VM is in

Hello,

We have 5 vCenters and it can be a challenge to find a VM at times. I'm making a script that connects to each vCenter then I'm trying to find a 'get-vm' command that will pull the vCenter that the VM is in. But I'm not able to find this. Can anyone tell me with PowerCli, how I can pull the name of the vCenter a VM is in?

Thanks,

Scott

Reply
0 Kudos
1 Solution

Accepted Solutions
scotty_p
Enthusiast
Enthusiast
Jump to solution

I was able to find it in ExtensionData.Client.ServiceUrl

Thanks.

View solution in original post

Reply
0 Kudos
2 Replies
scotty_p
Enthusiast
Enthusiast
Jump to solution

I was able to find it in ExtensionData.Client.ServiceUrl

Thanks.

Reply
0 Kudos
jasoncain_22
Enthusiast
Enthusiast
Jump to solution

Are you able to retrieve this information quickly when needed? I love the clean output.

I am working on a function that parses the result of this: get-vm <VM> | select Uid

Reply
0 Kudos