Tools4everBV / HelloID-Task-SA-Target-ExchangeOnPremises-SharedMailboxGrantSendAs

Exchange On Premises - Shared Mailbox - Grant Send As

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HelloID-Task-SA-Target-ExchangeOnPremises-SharedMailboxGrantSendAs

Prerequisites

Before using this snippet, verify you've met with the following requirements:

  • User defined variables: $ExchangeAdminUsername, $ExchangeAdminPassword and $ExchangeConnectionUri created in your HelloID portal. See also Custom Variables

Description

This code snippet executes the following tasks:

  1. Define a hash table $formObject. The keys of the hash table represent the properties of the Add-AdPermission cmdlet, while the values represent the values entered in the form.

To view an example of the form output, please refer to the JSON code pasted below.

{
    "MailboxIdentity": "TestSharedMailbox",
    "DisplayName": "TestSharedMailbox",
    "UsersToAdd": [
        {
            "UserPrincipalName": "jan@connectors.com"
        }
    ]
}

❗ It is important to note that the names of your form fields might differ. Ensure that the $formObject hashtable is appropriately adjusted to match your form fields. The MailboxIdentity can hold different values See the Microsoft Docs page

  1. Constructs a PowerShell credential object from the supplied administrative username and password

  2. Connects with the credentials to the Exchange on premises environment by means of the New-PSSession cmdlet

  3. Calls the Add-AdPermission cmdlet and adds ExtendedRights "Send As" to a Mailbox

  4. Disconnects from the Exchange session by means of the Remove-PsSession cmdlet

About

Exchange On Premises - Shared Mailbox - Grant Send As


Languages

Language:PowerShell 100.0%