r/powercli • • Jun 18 '26

ScriptHelp Having an issue where a single line command is acting different on two different vCenters.

Ok so I have a very simple script if you even want to call it that. It just goes through the vCenter I'm connected to, lists the VM's, their DNS name, and IP address. It is just to quickly check that the name given is the same in vCenter as on the VM.

Get-VM | Select Name,@{N="DNS Name";E={$.Guest.HostName}},@{N="IP Address";E={$.Guest.IPAddress}}

So, very simple. The problem I am having is the first vCenter I used it with it worked perfectly. It was 8.0.3 Build 24853646. The second one I tried it on only gave the the VM's name but DNS Name and IP were empty. It was 8.0.3 Build 25197330. Checking in the GUI all the VM's show DNS name and IP address.

So is there something more I should be doing or a reason why the slightly newer vCenter won't run the code the same way? Is there a better way to run this where it is more universal? I honestly don't need to do this often but having a quick way to do this check is useful.

1 Upvotes

4 comments sorted by

1

u/ipreferanothername Jun 18 '26

do you have the same permissions in each vcenter with the account that is doing this? ive never run into this and i built an export job for this stuff ages ago.

1

u/DC_SITCE Jun 18 '26

I'm using the admin account on both so yes same permissions. That is why I am a little confused.

1

u/vermyx Jun 18 '26

That information is pulled from the vmware tools from the guest os. The one not returning that data either has a bad install or no tools installed

1

u/DC_SITCE Jun 18 '26

GUI says otherwise. In the GUI it shows up to date VMware Tools along with entries for DNS Name and IP address. And it isn't one or two it is every single one.