I have covered this topic in a previous post, but in that occasion I only explained how to add one or more users to a single group. Sometimes you have different requirements, and it could be useful to be able to add one or more users to one or more groups with the same script. […]
Checking and comparing user AD group membership
In the AD module for PS there’s an easy cmdlet that allow us to check the groups a user is member of. We’re talking about Get-ADPrincipalGroupMemberShip. Let’s check the sintaxis: Interpreting the sintaxis, we are able to conclude the following: Because “-Identity” parameter and value “<ADPrincipal>” aren’t enclosed in square brackets we know is mandatory. […]