Removes e-mail–related permissions on a Microsoft Online Services user account.

Syntax

  •   Copy Code
    Remove-MSOnlineMailPermission [-RemoveSendAs] [-Identity] <String> [-Credential <PSCredential>] [-RemoveSendAs] [-RemoveFullAccess] -TrustedUser <string>
    
  •   Copy Code
    Remove-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.

Note
If not specified, the permission will not be granted. If specified, the default value will be true.

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.

Note
If not specified, the permission will not be granted. If specified, the default value will be true.

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.

Note
If not specified, the permission will not be granted. If specified, the default value will be true.

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

  1. 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

  2. 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.

      Copy Code
    $csv = Import-Csv –Path c:\RemovePermissions.csv
    $csv | Remove-MSOnlineMailPermission -Credential $cred
    
    Sample CSV file:

      Copy Code
    Column 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.

See Also

©2009 Microsoft Corporation. All rights reserved.  Legal | Privacy