Obtain Guest Subnet Mask

This post was originally published on this site

Hello,

 

I’ve been up and down the internet and cannot seem to find an answer to this.

 

I’m trying to script output to include a Guest VM’s IP address and its Subnet Mask.  I cannot seem to find any command that will present it without having to provide an account to the VM (Get-VMGuestNetworkInterface).  Isn’t VMtools aware of the IPaddress and netmask?  Maybe this is so simple I’m overlooking something.

 

I’m looking for something like this:  Get-Cluster “<cluster>” | Get-VM | Select Name, {$_.Guest.IPAddress}, {$_.ExtensionData.Summary.Guest.Subnet}

 

Obviously “Guest.Subnet” isn’t a valid parameter, but is there something that would work in its place?

 

Thanks in advance!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.