Wednesday, March 2, 2022

To change ESXi root user description via Vcenter Power cli.

 To change ESXi root user description via Vcenter Power cli.


# csv file should have heading with ESXi, username, password

$csv = Import-csv .\esxi.csv

foreach ($line in $csv)

{

Connect-VIServer -Server $($line.ESXi) -User $($line.username) -Password $($line.password) -WarningAction silentlyContinue


Get-VMHostAccount -User root | Set-VMHostAccount -Description admin6 -Confirm:$false | Out-Null -ErrorAction SilentlyContinue


Disconnect-VIServer -Server $($line) -Confirm:$false


}

No comments: