문제

To revoke permissions for GrantSendOnBehalfTo from a mailbox, it is pretty well documented, that you would do this:

Set-Mailbox -Identity MyMailbox -GrantSendOnBehalfTo $null

That works when run from powershell and in a local script.

However, if I include it in a script, that runs remote powershell (using New-PSSession etc), it fails with this error:

Couldn't find object "[Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter]". Please make sure that it was spelled correctly or specify a different object. + CategoryInfo : NotSpecified: (:) [], ManagementObjectNotFoundException + FullyQualifiedErrorId : A32A9BAB

So it will not accept $null as a parameter.

How can I get around that?

도움이 되었습니까?

해결책

Realistically, especially if this was Office 365 with DirSync, the easiest way would be to leave the publicDelegates attribute empty in the AD.

Make sure to use the UPN for the identity (which isn't required if working with a single mailbox):

Set-Mailbox -identity xxx@something.com -grantSendOnBehalfTo $null

or

Set-Mailbox xxx@something.com -grantSendOnBehalfTo $null
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top