Removes e-mail–related permissions on a Microsoft Online Services user account.
Syntax
-
Copy CodeRemove-MSOnlineMailPermission [-RemoveSendAs] [-Identity] <String> [-Credential <PSCredential>] [-RemoveSendAs] [-RemoveFullAccess] -TrustedUser <string>
-
Copy CodeRemove-MSOnlineMailPermission [-RemoveSendOnBehalfOf] [-Identity] <String> [-Credential <PSCredential>] [-RemoveSendAs] [-RemoveFullAccess] -TrustedUser <string>
Parameters
| Parameter | Required | Type | Description | ||
|---|---|---|---|---|---|
|
Credential |
No |
System.Management.Automation.PSCredential |
Specific credentials used to access Microsoft Online Services. |
||
|
Identity |
Yes |
System.string |
Selects a single user by name, e-mail address, UPN, or GUID. |
||
|
RemoveFullAccess |
No |
Boolean |
The mailbox right to be removed from the specified mailbox for the specified user.
|
||
|
RemoveSendAs |
No |
Boolean |
The Extended AD permission to be removed from the specified mailbox for the specified user. Can be specified as $true or $false.
|
||
|
RemoveSendOnBehalfOf |
No |
Boolean |
The Extended Mailbox right to be removed from the specified mailbox for the specified user. Can be specified as $true or $false.
|
||
|
TrustedUser |
Yes |
System.string |
This parameter specifies the user account from which to remove the specified permissions on the mailbox specified by the Identity parameter. TrustedUser can be specified by the trusted user’s user name. |
Example
- This command takes away full access and send as permissions on
the user@example.com’s (Identity) mailbox from admin@example.com
(TrustedUser) using the $cred credentials to perform the
action.
Remove-MSOnlineMailPermission Identity user@example.com -Credential $cred -TrustedUser admin@example.com –RemoveFullAccess True –RemoveSendAs True
- The first command sets $csv equal to the Import-Csv command
with the path to the RemovePermissions.csv file. The second command
pipes the contents of the $csv variable to the
Remove-MSOnlineMailPermission cmdlet and passes the $cred
credentials.
Sample CSV file:
Copy Code$csv = Import-Csv –Path c:\RemovePermissions.csv $csv | Remove-MSOnlineMailPermission -Credential $cred
Copy CodeColumn Titles: Identity,TrustedUser,GrantFullAccess,GrantSendAs Row1: user1@example.com,admin@example.com,True,True Row2: user2@example.com,admin@example.com,True,False
Comments
None.
Note