0

我的 Exchange 2010 用户有许多 smtp 地址,我想删除除其中两个之外的所有地址。尝试以下没有运气:

get-mailbox test_2 | foreach { $a = $_.emailaddresses; $b = $_.emailaddresses; foreach($e in $a) { if (($e.tostring() -match "donotdelete") -and ($e.tostring() -notmatch "donotdelete2")) { $b -= $e; } } ; $_ | set-mailbox -emailaddresses $b }

我究竟做错了什么?

4

1 回答 1

0

尝试这个:

$mbx = get-mailbox test_2 
$emailAddresses = $mbx.emailaddresses | where { "put your your filter code here  }
set-mailbox $mbx -emailaddresses $emailAddresses
于 2012-05-31T10:52:50.977 回答