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. […]
Iterate a shared network folder to look into domain users or security group permissions
The Get-Acl cmdlet can help us to obtain the access control list of a resource, for example a directory. With this information we can determine the permissions that a domain user or a security group has over a resource. Let’s check the help for this command: The Get-Help shows three different sets of parameters for […]
Moving users or computers in AD with the Move-ADObject cmdlet
According to the official documentation, Move-ADObject “Moves an Active Directory object or a container of objects to a different container or domain”. The straightforward noun-verb structure of PS also suggest what you can do with it. Let’s review the syntax: Both -Identity and -TargetPath are obligatory parameters. Regarding -Identity, we can use a distinguished name […]
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. […]
Add several users to an AD group with PowerShell
If you use the Active Directory Module for PowerShell, we’re going to review a couple of simple applications of the ADGroupMember cmdlet. This article will work for you if you need to add one or several users to the same AD group. Using Add-ADGroupMember cmdlet To start using this cmdlet, you can copy and paste […]