January 2015
Intermediate to advanced
230 pages
5h 4m
English
Sometimes, you might find a need to compare membership of two security groups. This is generally required to find whether they are identical. This not only helps in getting rid of duplicate groups, but also in troubleshooting permission issues. The function discussed in the following code takes two group names as input and compares their members. The output contains a report that shows the number of objects that exist in both the groups, and the number of objects that are found in the first group but not the second and vice versa:
Function Compare-ADGroups { [CmdletBinding()] Param( [Parameter(Mandatory=$true, Position = 0)] [String]$Group1, [Parameter(Mandatory=$true, Position = 1)] [String]$Group2, [Parameter(Position ...Read now
Unlock full access