Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 禁用统一消息_Powershell - Fatal编程技术网

Powershell 禁用统一消息

Powershell 禁用统一消息,powershell,Powershell,我正在构建一个用户存档脚本,并希望获得一些帮助,以禁用用户的统一消息。我想包括一个签入,以查看用户在禁用统一消息之前是否启用了统一消息,这样我就可以避免错误 目前我拥有的是: $username = Read-host "Enter uSername" Disable-UMMailbox -Identity $username 我想是我们的人干的。以下是脚本: $username = Read-host "Enter uSername" if ( Get-Mailbox -Identity $

我正在构建一个用户存档脚本,并希望获得一些帮助,以禁用用户的统一消息。我想包括一个签入,以查看用户在禁用统一消息之前是否启用了统一消息,这样我就可以避免错误

目前我拥有的是:

$username = Read-host "Enter uSername"
Disable-UMMailbox -Identity $username

我想是我们的人干的。以下是脚本:

$username = Read-host "Enter uSername"
if ( Get-Mailbox -Identity $username | where-object {$_.UMEnabled -eq $true}) {
  Disable-UMMailbox -Identity $username
} else {
  Write-Host "no voicemail enabled"
}

我把它给我们的人看了。这是剧本$username=Read host“Enter username”如果(获取邮箱-标识$username | where object{$$\ UMEnabled-eq$true}{Disable-UMMailbox-Identity$username}否则{写主机“未启用语音邮件”}您应该将其作为自己的答案而不是评论发布。请确保,这样问题将从“未回答”队列中删除。谢谢。我刚做完。