Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tools4everbv/helloid-task-sa-target-azureactivedirectory-accountupdateattributes
AZURE Active Directory - User account update attributes
https://github.com/tools4everbv/helloid-task-sa-target-azureactivedirectory-accountupdateattributes
azure-active-directory delegated-form powershell product service-automation task
Last synced: about 1 month ago
JSON representation
AZURE Active Directory - User account update attributes
- Host: GitHub
- URL: https://github.com/tools4everbv/helloid-task-sa-target-azureactivedirectory-accountupdateattributes
- Owner: Tools4everBV
- Created: 2023-03-03T12:24:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T11:26:08.000Z (12 months ago)
- Last Synced: 2024-01-10T12:39:16.040Z (12 months ago)
- Topics: azure-active-directory, delegated-form, powershell, product, service-automation, task
- Language: PowerShell
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HelloID-Task-SA-Target-AzureActiveDirectory-AccountUpdateAttributes
## Prerequisites
Before using this snippet, verify you've met with the following requirements:
- [ ] AzureAD app registration
- [ ] The correct app permissions for the app registration
- [ ] User defined variables: `AADTenantID`, `AADAppID` and `AADAppSecret` created in your HelloID portal.## Description
This code snippet executes the following tasks:
1. Define a hash table `$formObject`. The keys of the hash table represent the properties necessary to create a new user within `Azure Active Directory`, 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
{
"userIdentity": "",
"UserType": "",
"DisplayName": "",
"UserPrincipalName": "",
"GivenName": "",
"SurName": "",
"Mail": "",
"Department": "",
"JobTitle": "",
"MailNickName": "",
"ShowInAddressList": "",
"Password": "",
"ForceChangePasswordNextSignIn": "",
"AccountEnabled": ""
}
```> :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 **UserIdentity** accepts different values [See the Microsoft Docs page](https://learn.microsoft.com/en-us/powershell/module/activedirectory/move-adobject?view=windowsserver2022-ps#description)2. Receive a bearer token by making a POST request to: `https://login.microsoftonline.com/$AADTenantID/oauth2/token`, where `$AADTenantID` is the ID of your Azure Active Directory tenant.
3. Update a user by using the: `Invoke-RestMethod` cmdlet. The hash table called: `$formObject` is passed to the body of the: `Invoke-RestMethod` cmdlet as a JSON object.
> Its important to note that this snippet handles a `Microsoft.PowerShell.Commands.HttpResponseException` which is only available when using the Service-Automation cloud agent. If you want to use the Service-Automation on-premises agent, make sure to change this to: `System.Net.WebException`.