I have written this script :
function Green
{
process { Write-Host $_ -ForegroundColor Green }
}
function Red
{
process { Write-Host $_ -ForegroundColor Red }
}
$vcsa= Read-Host "Please enter your VCSA IP/FQDN"
Connect-VIServer -server $vcsa
"There are follow Hosts in your cluster:"
Get-VMHost | Format-Table Name
"Please Press any key to apply changes:"
Read-Host
Write-Output "6- esxi-7.account-auto-unlock-time" | Green
At the first step it shows all hosts in vCenter and after that I have a few changes that want to apply such as below:
Write-Output "6- esxi-7.account-auto-unlock-time" | Green
Get-AdvancedSetting Security.AccountUnlockTime | Set-AdvancedSetting -Value 900
Write-Output "7- esxi-7.account-lockout" | Green
Get-AdvancedSetting Security.AccountLockFailures | Set-AdvancedSetting -Value 3
How should change it ?
Please mark helpful or correct if my answer resolved your issue.