Exchange Groups are one of the most popular features in Exchange Server. Administrators delegate users the SendAs permission to the users to send emails using the group name and email address instead of their corporate account name.

I wrote a PowerShell script to list all these permission for both Exchange Online and Exchange on-premise.

Download the Exchange SendAS Script Reporter

You can download the PowerShell script from my GitHub repo here

Prerequisites

  • The Script needs to get a list of distribution groups for Exchange Online
  • The Script needs to get a list of distribution group for Exchange on-premise and also read Group permission (Get-ADPermission – Get-DistributionGroup)
  • PowerShell 5.1 or 7

How to use the Exchange Sendas

The script accepts the following parameters:

  • [Switch] ReportAll: This parameter generates an HTML report for all Exchange Online and on-premise distribution groups SendAs and SendOnBehalf permission. This report contains the following fields:
    • OnPremGroupName: Name of the distribution group.
    • OnPremSendOnBehalf: Users with GrantSendOnBehalf permission (On-premise).
    • OnPremSendAs: Users with SendAs Permission on the distribution group (On-premise).
    • IsSyncedGroup: The group is synced to Exchange Online or not
    • OnCloudSendAs: Users with SendAs permission on Exchange Online distribution group.
    • OnCloudSendOnBehalf: Users with GrantSendOnBehalf permission on Exchange Online distribution group.
  • [Switch] OnPremOnly: This parameter generates an HTML report for all on-premise only distribution groups SendAs and SendOnbehalf. The report contains the following fields:
    • OnPremGroupName: Name of the distribution group
    • OnPremSendOnBehalf: Users with GrantSendOnBehalf permission (On-premise).
    • OnPremSendAs: Users with SendAs Permission on the distribution group (On-premise).
  • [Switch] CloudOnly: This parameter generates an HTML report for Exchange Online distribution groups SendAs and SendOnbehalf. The report contains the following fields:
    • GroupName: Name of the distribution group
    • OnCloudSendAs: Users with SendAs permission on Exchange Online distribution group.
    • OnCloudSendOnBehalf: Users with GrantSendOnBehalf permission on Exchange Online distribution group.
  • [String] OnPremExchangeServer: The Local Exchange Server FQDN myserver.mydomain.local
  • [validateset] Auth: The authentication method to use, Kerberos, Basic, Default

When using CloudOnly parameter, there is no need to set any additional parameter

Examples on using the script

Using the –ReportAll parameter:

.\Get-SendAsReport.ps1 -ReportAll -OnPremExchangeServer mylocal.server.local -Auth Default
Report view
Full report

Using the -CloudOnly Parameter:

.\Get-SendAsReport.ps1 -CloudOnly
Cloud Only report

Using the -OnPremOnly Parameter:

.\Get-SendAsReport.ps1 -OnPremOnly -OnPremExchangeServer mylocal.server.local -Auth Default

The report will be similar to -CloudOnly parameter but the output are related to on-premise server.

Clean Exchange Server Services Logs and Free a lot of space easily

Enable Exchange Maintenance Mode On/Off with easily Using EMM PowerShell module

Rate this post