Summary: This article explains how to import and export Dynamic groups using PowerShell script. You can use this script to migrate Dynamic groups to Cayosoft Administrator. Below in this article, you will find the description of script parameters and the script usage examples.
Applies to: Cayosoft Administrator 6.4 or later
To create Dynamic Group rules in bulk, you can follow this procedure:
- Export existent Dynamic Group from Cayosoft Administrator or from the other tool to the CSV file.
Important: To prevent losing umlauts inside LDAP filters during export/import, only the Utf-8 file format is supported.
- Modify the output CSV file in Excel or text file editor, adding a new row per Dynamic Group and using the exported data as an example.
- Run PowerShell script, pointing to the prepared file, to import Dynamic Groups to Cayosoft Administrator.
- To see new Dynamic Groups in Cayosoft Administrator Console, select Dynamic Groups node and click Refresh Groups command.
To update membership rules for existing Dynamic Groups, follow a similar procedure and use the -ImportMode Replace parameter on import to replace rules with new definitions.
Export sample Dynamic Group to the CSV file including its schedule:
Add new membership rule to existing Dynamic Group:
Replace Dynamic Group membership rules with new rules defined in the CSV file:
- Import parameters
- [-Import ]
- [-ImportMode Append] (default, optional)
- [-ImportMode Replace] (optional)
- [-Compare] (optional)
- Export parameters
- [-DC] (required)
- [-Credential] (required)
- Common parameters
- [-GroupType AD] (default, optional)
- [-IncludeSchedule] (optional)
- [-IncludeOutput] (optional)
Import Dynamic Groups.
This parameter is used by default. It adds new membership rules that are added to CSV file to existing Dynamic Groups.
Replace Dynamic Group membership rules with new rules defined in the CSV file.
For each created or updated Dynamic Group, reads the current group membership in Active Directory, compares to the new membership rules and display members to be added and to be removed once the Dynamic Group rule would be executed. It also shows the total members count.
Exports Dynamic Groups.
Exports Dynamic Group by its rule name. To get the rule name:
- Open Cayosoft Administrator console.
- Open Dynamic Group properties.
- Browse for Advanced section.
- Copy the name from the Rule name setting.
Specifies Domain Controller that will lookup the Dynamic Groups.
Specifies credential to access the Domain Controller.
Specifies the path to the output CSV file.
The script supports only Active Directory Groups.
Specifies if export\import must include Dynamic Groups schedule.
Specifies if export\import must include Dynamic Groups output section.