VMware Cloud Community
nicholas1982
Hot Shot
Hot Shot
Jump to solution

Get-VMHostAdvancedConfiguration is obsolete

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.

Nicholas
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Like this

$esx = Get-VMHost -Name MyEsx

Get-AdvancedSetting -Entity $esx -Name Security.AccountUnlockTime


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
nicholas1982
Hot Shot
Hot Shot
Jump to solution

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)

Nicholas
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos