Hi,
Is there a way to enable/disable SSH (security settings). By default I have it disabled so no remote connection can be done over ssh. There are times when I do have to jump on take a quick peek though so I am wanting to get away from having to use vcenter.
I am not talking about "lockdown mode"
thanks
You mean something like this ?
Get-VMHost | Get-VMHostService |
where {$_.Key -eq "TSM-SSH"} |
Start-VMHostService -Confirm:$false
Or this
Get-VmHost | %{ $_.ExtensionData.ExitLockdownMode() }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You mean something like this ?
Get-VMHost | Get-VMHostService |
where {$_.Key -eq "TSM-SSH"} |
Start-VMHostService -Confirm:$false
Or this
Get-VmHost | %{ $_.ExtensionData.ExitLockdownMode() }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
As always... perfect LucD
thank you!!!
Hi,
How we can set "Start and stop with host" in this script for a cluster.
Thanks
With the Set-VMHostService cmdlet.
Loop through all nodes in the cluster
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
I am using below script. Is it correct for a cluster ?
$Cluster = "Cluster Name"
$VMHost = Get-Cluster -Name $Cluster | Get-VMhost
ForEach ($VMhost in $Cluster){
Write-Host -ForegroundColor GREEN "Starting SSH Service on " -NoNewline
Write-Host -ForegroundColor YELLOW "$VMhost"
Get-VMHost | Get-VMHostService | ? {($_.Key -eq "TSM-ssh") -and ($_.Running -eq $False)} | Start-VMHostService
}
ForEach ($VMhost in $Cluster){
Write-Host -ForegroundColor GREEN "Setting Startup Policy on " -NoNewline
Write-Host -ForegroundColor YELLOW "$VMhost"
Get-VMHost | Get-VMHostService | where { $_.key -eq "TSM-SSH" } | Set-VMHostService -Policy "On" -Confirm:$false -ea 1
}
ForEach ($VMhost in $Cluster){
Write-Host -ForegroundColor GREEN "Setting UserVar to supress Shell warning on " -NoNewline
Write-Host -ForegroundColor YELLOW "$VMhost"
Get-VMhost | Get-AdvancedSetting | Where {$_.Name -eq "UserVars.SuppressShellWarning"} | Set-AdvancedSetting -Value "1" -Confirm:$false
}
Thanks