Views:

Applies To:

GroupID 8 and above - GroupID Management Shell

Business Requirement:

I have a large number of managed groups and Dynasties in the directory. I want to export all of these to a CSV file and sort them accordingly.

More Information:

For more information on managed groupssee How GroupID classifies groups.

Solution:

Use GroupID Management Shell to get a list of managed groups and Dynasties in the directory. The ManagedGroupType attribute represents the different types of groups and can have the following outputs:

1 = Non-managed group
2 = Smart Group
3 = Parent Dynasty
4 = Middle Dynasty
5 = Leaf Dynasty
6 = Password Expiry SmartGroup

Steps:

  1. Launch GroupID Management Shell.

  2. Type the following commandlet:

    Get-SmartGroup | select DisplayName, ManagedGroupType | Sort-Object ManagedGroupType | Export-CSV "C:\list.csv" –NoTypeInformation

This cmdlet will export all Smart Groups and Dynasties to a CSV file.

The Get-SmartGroup cmdlet retrieves managed groups from one or more containers on a domain, and match the given criteria. Sample output is as follows:

As mentioned earlier, ManagedGroupType 2 represents Smart Groups, 3 represents parent Dynasties, and so on.

The cmdlet saves your CSV file to the C:\ directory with the name, list.csv. To change the directory, add your desired directory in place of C:\list.csv. The CSV file is sorted in ascending order based on the ManagedGroupType attribute.

You can get more information by appending the desired attributes to the cmdlet (for example, smartGroupType, expiration, managed by, whencreated, UPN, criteria SearchContainer, SearchContainersScopeList, Identity, ShouldReturnCollection, MaxItemsToDisplay, ObjectType, LdapFilter, SmartFilter, etc.) and sort the groups based on those attributes as well.

Reference:

GroupID Management Shell User Guide