- The HelloID SA on-premises agent installed
- The ActiveDirectory module is installed on the server where the HelloID SA on-premises agent is running.
- User-defined variable
ADgroupsSearchOU
created in your HelloID portal. Containing a Json string array of Active Directory OU's to search in.
Example value
[{ "OU": "OU=Groups,DC=helloid,DC=local"}]
This code snippet executes the following tasks:
- Imports the ActiveDirectory module.
- Define a wildcard search query
$searchQuery
based on the search parameter$datasource.searchValue
- Loop through the list of AD search OU's defined in the User-defined variable
ADgroupsSearchOU
and retrieve the AD groups using theGet-ADGroup
cmdlet.
The filter property -filter accepts different values See the Microsoft Docs page
- Return a hash table for each group using the
Write-Output
cmdlet.
To view an example of the data source output, please refer to the JSON code pasted below.
{
"searchValue": "Application"
}