I have been faced with the task of determining what domain our guest machines have been joined to. We have a few different domains, and don't have a good track record of keeping track of which servers are on what. The question is: Is there an easy way to extract this information using PowerCLI? I consulted the help files but did not see anything that was an obvious answer.
Thanks!
Hello, hansoac.
You could just get-vm all the vms you need and ".Guest.HostName" it. You wiil get fqdn of vm.
For example:
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm=get-
vm Garant
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
Garant PoweredOn 2 4,000
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm.Gues
t.HostName
GARANT.mfc22.local
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI>
Discussion moved from VMware vCenter™ to VMware vSphere™ PowerCLI
Hello, hansoac.
You could just get-vm all the vms you need and ".Guest.HostName" it. You wiil get fqdn of vm.
For example:
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm=get-
vm Garant
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
Garant PoweredOn 2 4,000
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vm.Gues
t.HostName
GARANT.mfc22.local
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI>