Advertisement
Last time I had the situation that an employee switched from one department to another, thus all security groups need to get updated. If this is the case, you can simply copy the Active Directory groups from another user of the new department.
Although this is just a very simple one-liner, it is still a very useful command and can save a lot of time.
Import-Module ActiveDirectory
Get-ADUser -Identity <copyFromUser> -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members <updateThisUser>
Advertisement
Advertisement