I'm try to query the ESXi Host advance configuration but i get the following warning.
The cmdlet still works "Get-VMHostAdvancedConfiguration -VMHost $vihost -Name Security.AccountUnlockTime"
Although wondering how would i do this with Get-AdvancedSetting cmdlet
WARNING: The command 'Get-VMHostAdvancedConfiguration' is obsolete. Use Get-AdvancedSetting cmdlet instead.
Try like this
$esx = Get-VMHost -Name MyEsx
$report = Get-AdvancedSetting -Entity $esx -Name Security.AccountUnlockTime | %{
New-Object PSObject -Property @{
$_.Name = $_.Value
}
}
$report | Export-Csv -Path C:\Temp\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Like this
$esx = Get-VMHost -Name MyEsx
Get-AdvancedSetting -Entity $esx -Name Security.AccountUnlockTime
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc,
I'm having a bit of trouble getting the info into CSV, I get this for the value System.Collections.Hashtable+ValueCollection instead of just the number 5
$chk1 = Get-VMHostAdvancedConfiguration -VMHost $vihost -Name Security.AccountUnlockTime
$Report += New-Object PSObject -Property @{
"Security.AccountUnlockTime" = ($chk1.Values)
Try like this
$esx = Get-VMHost -Name MyEsx
$report = Get-AdvancedSetting -Entity $esx -Name Security.AccountUnlockTime | %{
New-Object PSObject -Property @{
$_.Name = $_.Value
}
}
$report | Export-Csv -Path C:\Temp\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference