Adam Brown
asked on
Powershell - Setting the memberof attribute
We're getting ready to redo our company AD infrastructure. One of the things my boss would like to do is build up some template users with appropriate security group memberships for different user roles and departments in the company. He's asked me to piece together a powershell script that will take the group memberships from one user and apply them to a newly created user. I know I've seen a script somewhere that was able to do something like this, but I can't really remember where I saw it. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you need the MS cmdlets you can do this, i was going to post before but had to test
(get-aduser TEMPLATEUSER -properties memberof).memberof | %{add-adgroupmember $_ NEWUSER}
(get-aduser TEMPLATEUSER -properties memberof).memberof | %{add-adgroupmember $_ NEWUSER}
ASKER