Adds e-mail–related permissions on a Microsoft Online Services user account.
Syntax
-
Copy CodeAdd-MSOnlineMailPermission [-GrantSendAs] [-Identity] <String> [-Credential <PSCredential>] -TrustedUser <string> [-GrantFullAccess]
-
Copy CodeAdd-MSOnlineMailPermission [-GrantSendOnBehalfOf] [-Identity] <String> [-Credential <PSCredential>] -TrustedUser <string> [-GrantFullAccess]
Parameters
| Parameter | Required | Type | Description | ||
|---|---|---|---|---|---|
|
Credential |
No |
System.Management.Automation.PSCredential |
Specific credentials used to access Microsoft Online Services. |
||
|
GrantFullAccess |
No |
Boolean |
The mailbox right to be granted to the specified user; can be specified as $true or $false.
|
||
|
GrantSendAs |
No |
Boolean |
The Extended AD permissions to be granted to the specified user on the mailbox. Can be specified as $true or $false.
|
||
|
GrantSendOnBehalfOf |
No |
Boolean |
The Extended Mailbox right to be granted to the specified user on the indentified mailbox. Can be specified as $true or $false.
|
||
|
Identity |
Yes |
System.string |
Selects a single user by name, e-mail address, UPN, or GUID. |
||
|
TrustedUser |
Yes |
System.string |
The User parameter specifies the user mailbox that the permissions are being granted to on the other mailbox. |
Example
- This command grants admin@example.com (TrustedUser) full access
and send as permissions on user@example.com’s (Identity) mailbox
using the $cred credentials to perform the action.
Add-MSOnlineMailPermission Identity user@example.com -Credential $cred -TrustedUser admin@example.com –GrantFullAccess True –GrantSendAs True
- The first command sets $csv equal to the Import-Csv command
with the path to the CSV file. The second command pipes the
contents of the $csv variable to the Add-MSOnlineMailPermission
cmdlet and passes the $cred credentials.
Sample CSV file:
Copy Code$csv = Import-Csv –Path c:\AddPermissions.csv $csv | Add-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