Copy Group memebership using PowerShell from one user to another

Clear2all Professional Blog new

Copy Group memebership using PowerShell from one user to another

Run Powershell as administrator (wasted 1 hr figuring this out. It does not work if not run as admin)

Import-module activedirectory

Then below command which accepts samaccount name of both users

Get-ADUser -Identity copyfrom -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members Copyto

Leave a Reply

Your email address will not be published. Required fields are marked *