Hello,
Could someone please help me to get the powershell script to fetch the adapter details from IDRAC.
Appreciate your help !
Ciao
You try this commands (You must have the SSH service enabled on the ESXi server):
$cred = Get-Credential
$cmd = "localcli hardware ipmi bmc get"
$session = New-SSHSession -ComputerName <hostname ESXi> -Credential $cred –AcceptKey
$result = Invoke-SSHCommand -SSHSession $session -Command $cmd
$result.Output
Thanks for the help,
I'm getting below error, could you pls assist.
PS C:\> $cred = Get-Credential
>> $cmd = "localcli hardware ipmi bmc get"
>> $session = New-SSHSession -ComputerName <xyz> -Credential $cred -AcceptKey
>> $result = Invoke-SSHCommand -SSHSession $session -Command $cmd
>> $result.Output
>>
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
New-SSHSession : The term 'New-SSHSession' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:3 char:12
+ $session = New-SSHSession -ComputerName <xyz> -Cr ...
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-SSHSession:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Invoke-SSHCommand : The term 'Invoke-SSHCommand' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:4 char:11
+ $result = Invoke-SSHCommand -SSHSession $session -Command $cmd
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-SSHCommand:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Ciao
Check if you have installed the Posh-SSH powershell module:
Find-Module Posh-SSH
If it is not installed try following these instructions:
PowerShell Gallery | Posh-SSH 3.0.0
Otherwise, you can simply connect in SSH (once the service is enabled) to the ESXi server and run the command "localcli hardware ipmi bmc get"
As an SSH client, you can use putty or even the PowerShell
Thanks a lot, i'm afraid to say it seems i'll not get the information i'm looking for.
Actually i need to know if adapter is supporting 10gbe or 25gbe, also how many ports are in use currently, As i have highlighted in snapshot at the beginning.
Ciao,
Ok, sorry but I understood the question wrongly
Have you tried using the following command directly from the ESXi host (once connected in SSH)
esxcli network nic list
or if you use the powercli
$cred = Get-Credential
$esx = "<esxi host>"
Connect-VIServer $esx -Credential $cred
$esxcli = Get-EsxCli -VMHost $esx -V2
$esxcli.network.nic.list.Invoke()
I took a look at the card model, I would say it only supports 10 Gbs
Thanks for the quick response,
Yes i do have this information available. But still i need to check total number of ports are available.
I've reported your thread so a moderator can move it to the area for PowerCLI.
Hello
what do you mean by the available ports (The ports with insert GBIC/SFP)?
The card model you indicated, if I remember correctly, has 2 ports at 10GB and 2 ports at 1GB