https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-sharedmailboxdelete
Exchange Online - Shared mailbox delete
https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-sharedmailboxdelete
delegated-form exchange-online powershell product service-automation task
Last synced: 27 days ago
JSON representation
Exchange Online - Shared mailbox delete
- Host: GitHub
- URL: https://github.com/tools4everbv/helloid-task-sa-target-exchangeonline-sharedmailboxdelete
- Owner: Tools4everBV
- Created: 2023-03-30T10:25:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T13:23:17.000Z (over 2 years ago)
- Last Synced: 2025-01-08T10:45:33.744Z (over 1 year ago)
- Topics: delegated-form, exchange-online, powershell, product, service-automation, task
- Language: PowerShell
- Homepage:
- Size: 69.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-SharedMailboxDelete
## 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 [Exchange-online-powershell-v2](https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps) for instructions
- [ ] User defined variables: `ExchangeOnlineAdminUsername` and `$ExchangeOnlineAdminPassword` created in your HelloID portal. See also [Custom Variables](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 shared mailbox to be deleted, 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" : "testshared1@myenvironment.onmicrosoft.com"
}
```
> :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 field **MailboxIdentity** accepts different values [See the Microsoft Docs page](https://learn.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps#-identity)
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 `Get-Mailbox` cmdlet to lookup the mailbox
5. Calls the `Remove-Mailbox` cmdlet to delete the mailbox. [Remove-Mailbox](https://learn.microsoft.com/en-us/powershell/module/exchange/remove-mailbox?view=exchange-ps)
6. Disconnects from the Exchange environment by means of the `Disconnect-ExchangeOnline` cmdlet