Views:

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:
  • Before making any changes to the current environment, it is highly recommended to create a backup/snapshot/checkpoint of the GroupID server.
  • It is also recommended to test the below-provided method on a small scale and once satisfied, use it in bulk.

Steps:

  1. 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
  2. Then import the CSV file and set the expiration policy accordingly using the following cmdlet:

    $Data = Import-CSV "PATH OF THE EXPORTED FILE"
    Foreach($d in $data) {Set-Group -Identity $d.Cn -ExpirationPolicy "120" -ExtendGroupLife}
    Where 120 represents the number of days before expiration. You can change its value as required.
Note:In case you run into problems, contact support@imanami.com.