Applies To:
GroupID 10 – GroupID Management Shell
Problem Statement:
We want to set the expiration policy for groups in bulk rather than setting it individually for each group.
Methodology:
We can use GroupID Management Shell to set the expiration policy for groups in bulk.
Note: |
|
Steps:
Launch GroupID Management Shell and export the Common Names of all the groups we want to apply the expiration policy to a CSV file using the following cmdlet:
Get-group | Select CN | Export-csv "PATH TO EXPORT FILE" -NoTypeInformation Or to limit the export to a certain OU, use the following cmdlet:
Get-group -SearchContainer "DN of the OU" | Select CN | Export-csv "PATH TO EXPORT FILE" -NoTypeInformation Then import the CSV file and set the expiration policy accordingly using the following cmdlet:
Where 120 represents the number of days before expiration. You can change its value as required.$Data = Import-CSV "PATH OF THE EXPORTED FILE"
Foreach($d in $data) {Set-Group -Identity $d.Cn -ExpirationPolicy "120" -ExtendGroupLife}
Note: | In case you run into problems, contact support@imanami.com. |