![](https://www.yjsec.com/wp-content/uploads/2021/03/wp_editor_md_84bf541a07e08c840106c2596edc4268.jpg)
# 登录vCenter Server
Connect-VIServer -Server <vCenter IP> -user Administrator@vsphere.local -password <密码>
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
# 查看SSH服务状态
$VMHost = Get-VMHost
foreach ($VMHost in $VMHost) {
Get-VMHostService -VMHost $VMHost | where {$_.Key -eq "TSM-SSH"} | Select @{N="VMHost";E={$VMHost.Name}},Key,Running
}
# 关闭SSH服务
$VMHost = Get-VMHost
foreach ($VMHost in $VMHost) {
Get-VMHostService -VMHost $VMHost | where {$_.Key -eq "TSM-SSH"} | Stop-VMHostService -Confirm:$false
}
文章评论