shankamu
Enthusiast
Enthusiast

PowerCLI script to Export standalone ESXi host License

Jump to solution

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,

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

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

  }

}

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

3 Replies
RvdNieuwendijk
Leadership
Leadership

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

  }

}

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

shankamu
Enthusiast
Enthusiast

Could you please help me with input file for ESXhosts and export the output file to csv file for 200+ hosts.

0 Kudos
shankamu
Enthusiast
Enthusiast

Could you please help me with input file for ESXhosts and export the output file to csv file for 200+ hosts.

0 Kudos