• Set-SendAs

    Help Information

    SYNOPSIS
    Set SendAs Permission on mailboxes hosted in Exchange Online/Office 365.

    DESCRIPTION
    Use this script to assign Send As permission for an account to all Exchange Online/Office 365 mailboxes

    NOTES
    Source: http://www.clintmcguire.com/
    Author: Clint McGuire
    Version 1.1
    Copyrigth 2012,2013
    Thanks to Evan Zhang for the Add-RecipientPermission syntax – http://community.office365.com/en-us/f/150/p/57642/210047.aspx

    LINK
    http://www.clintmcguire.com/set-sendas/

    EXAMPLES
    PS> Set-SendAs.ps1

    Version History

    1.1 Add Comment-based help

    1.o Initial Release

    Latest Version of Script

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    
    <#
    .SYNOPSIS
    Set SendAs Permission on mailboxes hosted in Exchange Online/Office 365.
     
    .DESCRIPTION
    Use this script to assign Send As permission for an account to all Exchange Online/Office 365 mailboxes 
     
    .NOTES
    Source: http://www.clintmcguire.com/
    Author: Clint McGuire
    Version 1.1
    Copyrigth 2012,2013
    Thanks to Evan Zhang for the Add-RecipientPermission syntax - http://community.office365.com/en-us/f/150/p/57642/210047.aspx
     
    .LINK
    http://www.clintmcguire.com/set-sendas/
     
    .EXAMPLES
    PS> Set-SendAs.ps1
     
    #>
     
    $MBXS = Get-Recipient -RecipientType usermailbox 
    ForEach ($MBX in $MBXS)
    {
        Add-RecipientPermission $MBX.name -AccessRights SendAs -Trustee CWAdmin@domain.com
    }
    Get-RecipientPermission | where {($_.Trustee -ne 'nt authority\self') -and ($_.Trustee -ne 'null sid')}
    <#
    .SYNOPSIS
    Set SendAs Permission on mailboxes hosted in Exchange Online/Office 365.
    
    .DESCRIPTION
    Use this script to assign Send As permission for an account to all Exchange Online/Office 365 mailboxes 
    
    .NOTES
    Source: http://www.clintmcguire.com/
    Author: Clint McGuire
    Version 1.1
    Copyrigth 2012,2013
    Thanks to Evan Zhang for the Add-RecipientPermission syntax - http://community.office365.com/en-us/f/150/p/57642/210047.aspx
    
    .LINK
    http://www.clintmcguire.com/set-sendas/
    
    .EXAMPLES
    PS> Set-SendAs.ps1
    
    #>
    
    $MBXS = Get-Recipient -RecipientType usermailbox 
    ForEach ($MBX in $MBXS)
    {
    	Add-RecipientPermission $MBX.name -AccessRights SendAs -Trustee [email protected]
    }
    Get-RecipientPermission | where {($_.Trustee -ne 'nt authority\self') -and ($_.Trustee -ne 'null sid')}

    To Dos

    Add parameter for Trustee to be passed on command line.

    Add parameter for selecting a smaller set of users, instead of all.

    Leave a Reply

    Your email address will not be published. Required fields are marked *