# Substitute the name of the user to remove for XXXXThere are probably more efficient ways to do this, but this script gets the job done. The only reason it's awkward is because GrantSendOnBehalfTo is a list that needs to be modified.
$ToRemove=(Get-Mailbox XXXX).DistinguishedName
$mailboxes=get-mailbox -ResultSize unlimited
Foreach ($m in $mailboxes) {
$current=$m.GrantSendOnBehalfTo
$new=$current-$ToRemove
Set-Mailbox $m -GrantSendOnBehalfTo $new
}
Tuesday, October 29, 2013
Remove SendOnBehalfOf Permission From All Mailboxes
Today a client was looking for a method to remove a specific user from the SendOnBehalfOf permission of all mailboxes. The following script performs the task:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment