Hi,
Could you you please help with correct script to Export standalone 200 vSphere6 ESXi host License. All hosts have common credentials and few are part of vCenter servers and few stand alone.
Regards,
You can use the following PowerCLI script to retrieve the license keys of the standalone ESXi hosts esx1.yourdomain.com and esx2.yourdomain.com:
$VMHosts = 'esx1.yourdomain.com','esx2.yourdomain.com'
foreach ($VMHost in $VMHosts)
{
$VIServer = Connect-VIserver -Server $VMHost -User root -Password 'secret'
if ($VIServer)
{
Get-VMHost -Server $VIServer | Select-Object -Property Name,LicenseKey
Disconnect-VIServer -Server $VIServer -Confirm:$false
}
}
You can use the following PowerCLI script to retrieve the license keys of the standalone ESXi hosts esx1.yourdomain.com and esx2.yourdomain.com:
$VMHosts = 'esx1.yourdomain.com','esx2.yourdomain.com'
foreach ($VMHost in $VMHosts)
{
$VIServer = Connect-VIserver -Server $VMHost -User root -Password 'secret'
if ($VIServer)
{
Get-VMHost -Server $VIServer | Select-Object -Property Name,LicenseKey
Disconnect-VIServer -Server $VIServer -Confirm:$false
}
}
Could you please help me with input file for ESXhosts and export the output file to csv file for 200+ hosts.
Could you please help me with input file for ESXhosts and export the output file to csv file for 200+ hosts.