An open API service indexing awesome lists of open source software.

https://github.com/tools4everbv/helloid-task-sa-target-exchangeonpremises-mailboxupdateattributes

Exchange On Premises - Mailbox update attributes
https://github.com/tools4everbv/helloid-task-sa-target-exchangeonpremises-mailboxupdateattributes

delegated-form exchange-on-premises powershell product service-automation task

Last synced: 2 months ago
JSON representation

Exchange On Premises - Mailbox update attributes

Awesome Lists containing this project

README

        

# HelloID-Task-SA-Target-ExchangeOnPremises-MailboxUpdateAttributes

## 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](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 `Set-Mailbox` 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": "TestShared02",
"MailboxDisplayName": "TestShared02",
"CustomAttribute1": "Custom01",
"CustomAttribute2": "10001",
"CustomAttribute3": null,
"CustomAttribute4": null,
"CustomAttribute5": null,
"CustomAttribute6": null,
"CustomAttribute7": null
}
```

> :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 **MailboxIdentity** (Identity) can hold different values [See the Microsoft Docs page](https://learn.microsoft.com/en-us/powershell/module/exchange/set-mailbox?view=exchange-ps)

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

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

4. Calls the `Set-Mailbox` cmdlet to update the mailbox; it updates only the ones with a value. Otherwise, a null value clears the current property.

5. Disconnects from the Exchange session by means of the `Remove-PSSession` cmdlet