- Execute the cmdlet Enable-PsRemoting on the Exchange server to which you want to connect.
- Within IIS, under the Exchange Back End site for the Powershell sub-site, check that the authentication method Windows Authentication is enabled.
- Permissions to manage the Exchange objects, the default AD group Organization Management should suffice, but please change this accordingly.
This code snippet executes the following tasks:
- Imports the ExchangeOnlineManagement module.
- Define
$mailboxGuid
based on theselectedMailbox
data source input$datasource.selectedMailbox.Guid
- Creates a session to Exchange using Remote PowerShell.
- List all recipients in Exchange On-Premises with
SendAs
permissions to the mailbox using the cmdlet: Get-RecipientPermission - Return a hash table for each user account using the
Write-Output
cmdlet.
To view an example of the data source output, please refer to the JSON code pasted below.
{
"selectedMailbox": {
"Guid": "7d53a91f-dd9d-41b3-94fb-143bd2fc6854"
}
}