baber
Expert
Expert

1- When we choose option 2 what does this mean here :

$esx = Get-VMHost

because we want to apply on all hosts and VMs

$esx = Get-VMHost
Get-AdvancedSetting -Entity $esx -Name 'Security.AccountUnlockTime' | Set-AdvancedSetting -Value 900

Get-VM -Location $esx |
ForEach-Object -Process {
New-AdvancedSetting -Entity $_ -Name 'log.keepOld' -Value '10' -Confirm:$false -Force
New-AdvancedSetting -Entity $_ -Name 'RemoteDisplay.maxConnections' -Value '1' -Confirm:$false -Force
New-AdvancedSetting -Entity $_ -Name 'log.rotateSize' -Value '2048000' -Confirm:$false -Force


2- How can change this such as your sample when we want to apply on all hosts and specific host?

Get-VMHost $hostname | Get-VMHostService | where {$_.Key -eq 'TSM-SSH'} | Set-VMHostService -Policy Off
Get-VMHost $hostname | Get-VMHostService | where {$_.Key -eq 'TSM-SSH'} | Stop-VMHostService -Confirm:$false

Please mark helpful or correct if my answer resolved your issue.
Reply
0 Kudos