使用脚本实现定期查询exchange2013/2016的代理主键服务修复


脚本命令如下:
##全部状态查询
function state{
get-exchangeserver| foreach{
 Get-ServerComponentState -Identity "$_.Name"
}
}
##筛选组建异常的
function proxyInactive{
state | where {$_.state -eq "InActive"}
}
#proxyInactive
##执行状态修正
proxyInactive |foreach{
Set-ServerComponentState -Identity $_.identity.name -State Active -Requester healthapi -Component $_.Component
}

你可能感兴趣的:(exchange,power,shell)