Hello All,
we need to gather the following information about all NICs in all hosts via PowerCLI:
- name
- manufacturer
- driver version
- firmware version
- MAC address
We know the esxcli method but it would take an awful lot of time as we have many hosts and they would send an alarm for disabling lockdown mode and enabling SSH so it would be extremely time-consuming and ineffective.
While googling we've found this method via Get-EsxCLI (http://jreypo.wordpress.com/tag/powercli/) but for some reason I cannot even list the NICs.
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli = Get-EsxCli -vmhost Host
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.system.module.get
TypeNameOfValue : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod
OverloadDefinitions : {vim.EsxCLI.system.module.get.ModuleDetails get(string module)}
MemberType : CodeMethod
Value : vim.EsxCLI.system.module.get.ModuleDetails get(string module)
Name : get
IsInstance : True
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.system.module.list
TypeNameOfValue : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod
OverloadDefinitions : {vim.EsxCLI.system.module.list.Module[] list(boolean enabled, boolean loaded)}
MemberType : CodeMethod
Value : vim.EsxCLI.system.module.list.Module[] list(boolean enabled, boolean loaded)
Name : list
IsInstance : True
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.network.nic.list
TypeNameOfValue : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod
OverloadDefinitions : {vim.EsxCLI.network.nic.list.Nic[] list()}
MemberType : CodeMethod
Value : vim.EsxCLI.network.nic.list.Nic[] list()
Name : list
IsInstance : True
Can anyone help me? Thanks in advance!
Add parenthesis to the method call
$esxcli.network.nic.list()
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I hope this helps you.
vGeek: PowerCLI esxi host Physical nic info in nice table format
Add parenthesis to the method call
$esxcli.network.nic.list()
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks guys.
I want to query an advanced option without success:
$esxcli.system.settings.advanced.list("Net.UseHwTSO")
The remote server returned an error: (500) Internal Server Error.
At E:\vm\PowerCli scripts\esxcli.ps1:10 char:1
+ $tsostate = $esxcli.system.settings.advanced.list("Net/UseHwTSO")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ViError
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViError
As I understand from its help:
Value : vim.EsxCLI.system.settings.advanced.list.SettingsAdvancedOption[]
list(string option, string tree)
Option should be the whole option (-o on console) and tree is the main category (here: net)
$esxcli.system.settings.advanced.list("Net.UseHwTSO","Net")
The remote server returned an error: (500) Internal Server Error.
At line:1 char:1
+ $esxcli.system.settings.advanced.list("Net.UseHwTSO","Net")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ViError
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViError
I am missing something here I think, can you help me out?
Did you try with
$esxcli.system.settings.advanced.list("/Net/UseHwTSO")
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I missed the root slash, thank you!