1 line Script to copy AD membership between users

Just copy and paste:

It will copy all membership groups from 1 user to another

import-Module ActiveDirectory;$copy = Read-host "Enter username to copy from: ";$paste = Read-host "Enter username to copy to: ";get-ADuser -identity $copy -properties memberof | select-object memberof -expandproperty memberof | Add-AdGroupMember -Members $paste;

2018-12-13 15_59_06-mRemoteNG - confCons.xml - CWUSERVER1.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s