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.
This script loops through a membership list of an Active Directory security group. A single mailbox (CRM/ERP service account mailbox) is added to each mailbox (CRM/ERP user mailbox) of the security group members to provide send-as permission.
The script has been developed as a solution to enable proper functionality with Dynamics NAV 2016.
# Assign Send-As permission to email@example.com for all members # of 'CRM-FrontLine' security group. The mailboxes as hosted On-Premises! .\Set-SendAsPermission.ps1 -SendAsGroup 'CRM-FrontLine' -SendAsUserUpn 'firstname.lastname@example.org'
# Assign Send-As permission to email@example.com for all members of 'AX-Sales' # security group. All mailboxes are hosted in Exchange Online! .\Set-SendAsPermission.ps1 -SendAsGroup 'AX-Sales' -SendAsUserUpn 'firstname.lastname@example.org' -ExchangeOnline
- Exchange Server 2016 or newer
- Exchange Online PowerShell connection
- Exchange Online PowerShell Module to connect w/ MFA
- Utilizes GlobalFunctions PowerShell Module
- 1.0, Initial community release
- Download and follow at Github: https://github.com/Apoc70/Set-SendAsPermission