-
The HelloID SA on-premises agent installed
-
The ActiveDirectory module is installed on the server where the HelloID SA on-premises agent is running.
This code snippet executes the following tasks:
- Define a hash table
$formObjectthat holds the values entered in the form.
To view an example of the form output, please refer to the JSON code pasted below.
{
"UserPrincipalName": "",
"ExpirationDate": "01/01/2023"
}❗ It is important to note that the names of your form fields might differ. Ensure that the
$formObjecthashtable is appropriately adjusted to match your form fields.
-
Imports the ActiveDirectory module.
-
Retrieve the user account object using the
Get-ADUsercmdlet. -
Update the account using the
$userobject retrieved from step 3 and update theExpirationDate.
💡 Its worth noting that the
ExpirationDatemust be a validDateTimeobject.