Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the broken Get-VMNetworkAdapter* commands. #69

Conversation

helmste
Copy link
Contributor

@helmste helmste commented Jun 9, 2023

The commands used to gather the virtual NIC data were not working for the host because they were incorrectly referencing the DeviceID. I updated the commands so they would gather the correct information.

@tmolenh
Copy link
Contributor

tmolenh commented Jul 21, 2023

Device ID does appear to be available for Host VNics ( -ManagementOS):

PS C:\WINDOWS\system32> get-vmnetworkadapter -ManagementOS | fl *


VMCheckpointId                          : 00000000-0000-0000-0000-000000000000
VMCheckpointName                        :
VmmqQueuePairs                          : 16
VmmqQueuePairsRequested                 : 0
IsManagementOs                          : True
MacAddress                              : 00155D0DDE3A
DeviceId                                : {70EBEFF6-10CD-400D-A29F-C6B4C0515E98}

@helmste
Copy link
Contributor Author

helmste commented Jul 25, 2023

Hi Tom,

Thanks for the reply. I'm sorry, I should have been more clear. You are correct that the Get-VMNetworkAdapter command itself does have DeviceID property available. My effort was to show that all of the other commands that start with Get-VMNetworkAdapter (Get-VMNetworkAdapterAcl, Get-VMNetworkAdapterExtendedAcl, Get-VMNetworkAdapterIsolation, Get-VMNetworkAdapterRoutingDomain, Get-VMNetworkAdapterTeamMapping and Get-VMNetworkAdapterVlan) do not have the DeviceID property available. Instead, these command reference the ParentAdapter like shown in the example below:

PS C:\> Get-VMNetworkAdapterAcl -ManagementOS | fl *


Action            : Allow
Direction         : Inbound
LocalAddress      :
LocalAddressType  : 0
MeteredMegabytes  :
RemoteAddress     : 100.100.100.100
RemoteAddressType : IPv4
ParentAdapter     : VMInternalNetworkAdapter, Name = 'TestvNic'
IsTemplate        : False
CimSession        : CimSession: .
ComputerName      : TestNode01
IsDeleted         : False

Action            : Allow
Direction         : Outbound
LocalAddress      :
LocalAddressType  : 0
MeteredMegabytes  :
RemoteAddress     : 100.100.100.100
RemoteAddressType : IPv4
ParentAdapter     : VMInternalNetworkAdapter, Name = 'TestvNic'
IsTemplate        : False
CimSession        : CimSession: .
ComputerName      : TestNode01
IsDeleted         : False

With the current code, all of the above mentioned commands error out. I have suggested an update that will get the name of the vnic and reference that within the ParentAdapter property to get the correct information.

@helmste
Copy link
Contributor Author

helmste commented Aug 24, 2023

@tmolenh, any update here? I have a lot of customers that use this module, but at times I must ask them to manually pull certain data due to this issue. Thanks for any assistance you can provide here.

@tmolenh
Copy link
Contributor

tmolenh commented Jan 13, 2024

I'm no longer with Microsoft, so I am unable to assist.

@AlvinTanMS AlvinTanMS merged commit 843babd into microsoft:master Jan 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants