This script adds a single user with send-as permissions to mailboxes which are members of a single security group.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
Set-SendAsPermission.ps1

README.md

Set-SendAsPermission.ps1

This script adds a single user with send-as permissons to mailboxes which are members of a single security group.

Description

This script loops through a membership list of an Active Directory security group. A single mailbox is added to each mailbox of the security group members to provide send-as permission.

The script can be used to assign an application account (e.g. CRM, ERP) send-as permission to user mailboxes to send emails AS the user and not as the application.

Requirements

Parameters

SendAsGroup

This is the name of the Active Directory security group containing all the users where the SendAsUserUpn needs to have send-as permission.

SendAsUserUpn

This is the UserPrincipleName of the user (service account) which will be granted send-ad permission.

ExchangeOnline

Use this switch, if the target mailbox are located in Exchange Online. In this case the script must be executed from within an Exchange Online PowerShell session.

Examples

.\Set-SendAsPermission.ps1 -SendAsGroup 'CRM-FrontLine' -SendAsUserUpn 'crmapplication@varunagroup.de'

Assign Send-As permission to crmapplication@varunagroup.de for all members of 'CRM-FrontLine' security group. The mailboxes as hosted On-Premises!

.\Set-SendAsPermission.ps1 -SendAsGroup 'AX-Sales' -SendAsUserUpn 'ax@granikoslabs.eu' -ExchangeOnline

Assign Send-As permission to ax@granikoslabs.eu for all members of 'AX-Sales' security group. All mailboxes are hosted in Exchange Online!

Note

THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.

TechNet Gallery

Download and vote at TechNet Gallery

Credits

Written by: Thomas Stensitzki

Stay connected:

For more Office 365, Cloud Security, and Exchange Server stuff checkout services provided by Granikos