Hi,
is ist possible to read the ESX-Host-Serialnumber?
Thx in advance...
Chakoe
Try my script in http://communities.vmware.com/message/1705969#1705969.
Regards, Robert
Hi Robert,
I´ve added a host to read (Line 48, Get-VMhost...) tried to start the script, but received the following error:
Get-WSManInstance : Access denied
At C:\Dokumente und Einstellungen\Username\Lokale Einstellungen\Temp\bb485930-9212-40bc-9133-5223289548a4.ps1:44 char:26
+ Get-WSManInstance <<<< -Authentication basic -ConnectionURI $uri -Credential $credential -Enumerate -Port 443 -UseSSL -SessionOption $option -ResourceURI "$baseUrl/$class"
+ CategoryInfo : InvalidOperation: (:) [Get-WSManInstance], UnauthorizedAccessException
+ FullyQualifiedErrorId : Exception,Microsoft.WSMan.Management.GetWSManInstanceCommand
Get-WSManInstance : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="5" Machine="workstation1"><f:Message>Zugriff verweigert </f:Messag
e></f:WSManFault>
At C:\Dokumente und Einstellungen\Username\Lokale Einstellungen\Temp\bb485930-9212-40bc-9133-5223289548a4.ps1:44 char:26
+ Get-WSManInstance <<<< -Authentication basic -ConnectionURI $uri -Credential $credential -Enumerate -Port 443 -UseSSL -SessionOption $option -ResourceURI "$baseUrl/$class"
+ CategoryInfo : InvalidOperation: (http://schemas....PhysicalPackage:Uri) [Get-WSManInstance], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.GetWSManInstanceCommand
Do i need special accessrights?
Thx
Chakoe
When connected to a vCenter server I don't need special access rights. But you can try to specify host credentials as in:
$HostCredential = Get-Credential Get-VMHost | ForEach-Object { $VMHost = $_ $PhysicalPackage = Get-VMHostWSManInstance -VMHost $_ -class CIM_PhysicalPackage -ignoreCertFailures -Credential $HostCredential | ` Where-Object {$_.ElementName -eq "Chassis"} $Report = "" | Select-Object -Property VMHost,SerialNumber $Report.VMHost = $VMHost.Name $Report.SerialNumber = $PhysicalPackage.SerialNumber $Report } | Export-Csv -NoTypeInformation -UseCulture -Path c:\Temp\EsxSerialNumbers.csv
How would I implement into this script to get BMC/IDRAC address of all of my hosts in vcenter.
Thanks
You could use plink to initiate an ssh connection to the host and then use RACADM to scrape the information that you are after.