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

Advertisement

One thought on “1 line Script to copy AD membership between users

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.