scotty_p
Enthusiast
Enthusiast

Find vCenter a VM is in

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
scotty_p
Enthusiast
Enthusiast

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

Thanks.

View solution in original post

0 Kudos
2 Replies
scotty_p
Enthusiast
Enthusiast

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

Thanks.

0 Kudos
jasoncain_22
Enthusiast
Enthusiast

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

0 Kudos