https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-mailboxrevokesendas
Exchange Online - Mailbox revoke send-as permissions
https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-mailboxrevokesendas
delegated-form exchange-online powershell product service-automation task
Last synced: 2 months ago
JSON representation
Exchange Online - Mailbox revoke send-as permissions
- Host: GitHub
- URL: https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-mailboxrevokesendas
- Owner: Tools4everBV
- Created: 2023-04-03T09:18:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T12:56:26.000Z (over 1 year ago)
- Last Synced: 2025-01-08T10:45:35.176Z (4 months ago)
- Topics: delegated-form, exchange-online, powershell, product, service-automation, task
- Language: PowerShell
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HelloID-Task-SA-Target-ExchangeOnline-MailboxRevokeSendAs
## Prerequisites
Before using this snippet, verify you've met with the following requirements:
- [ ] The PowerShell EXO v3 module must be installed on the server running the Agent. [See instructions](https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps)- [ ] User defined variables: `ExchangeOnlineAdminUsername` and `$ExchangeOnlineAdminPassword` created in your HelloID portal. [See also](https://docs.helloid.com/en/variables/custom-variables.html)
## 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 `Remove-RecipientPermission` 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.
```json
{
"MailboxIdentity": "[email protected]",
"UsersToRemove": [
{
"id": "JaneD01"
},
{
"id": "JohnD02@myenvironment"
},
{
"id": "d55a09fe-b231-XxXx-XxXx-9c369364e991"
}
]
}
```
> :exclamation: 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 **ID** can hold different values [See the Microsoft Docs page](https://learn.microsoft.com/en-us/powershell/module/exchange/remove-recipientpermission?view=exchange-ps#-trustee)2. Constructs a PowerShell credential object from the supplied administrative username and password
3. Connects with the credentials to the Exchange online environment by means of the `Connect-ExchangeOnline` cmdlet
4. Calls the `Remove-RecipientPermission` cmdlet to remove Send-As permissions from a recipient
5. Disconnects from the Exchange environment by means of the `Disconnect-ExchangeOnline` cmdlet