https://github.com/tools4everbv/helloid-task-sa-source-activedirectory-groupsearch
Active Directory - Group search
https://github.com/tools4everbv/helloid-task-sa-source-activedirectory-groupsearch
active-directory data-source powershell service-automation
Last synced: 5 months ago
JSON representation
Active Directory - Group search
- Host: GitHub
- URL: https://github.com/tools4everbv/helloid-task-sa-source-activedirectory-groupsearch
- Owner: Tools4everBV
- Created: 2024-01-31T08:56:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T09:15:33.000Z (over 1 year ago)
- Last Synced: 2025-01-08T10:45:09.299Z (6 months ago)
- Topics: active-directory, data-source, powershell, service-automation
- Language: PowerShell
- Homepage:
- Size: 27.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-Source-ActiveDirectory-GroupSearch
## Prerequisites
- [ ] 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
```json
[{ "OU": "OU=Groups,DC=helloid,DC=local"}]
```## Description
This code snippet executes the following tasks:
1. Imports the ActiveDirectory module.
2. Define a wildcard search query `$searchQuery` based on the search parameter `$datasource.searchValue`
3. Loop through the list of AD search OU's defined in the User-defined variable `ADgroupsSearchOU` and retrieve the AD groups using the `Get-ADGroup` cmdlet.> The filter property **-filter** accepts different values [See the Microsoft Docs page](https://learn.microsoft.com/en-us/powershell/module/activedirectory/get-adgroup?view=windowsserver2022-ps)
4. 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.
```json
{
"searchValue": "Application"
}
```