Solved

Powershell - Setting the memberof attribute

Posted on 2010-11-23
3
1,574 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:Adam Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
KenMcF earned 500 total points
ID: 34199242
you can do this with quest if you want to use their cmdlets.

get-qadmemberof TEMPLATEACCOUNT | %{add-qadgroupmember $_ NEWUSERNAME}
0
 
LVL 41

Author Comment

by:Adam Brown
ID: 34199276
Thanks Ken. Was different than what I was thinking of, but that did the trick. And I just about had it figured out myself, too...
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 34199308
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}
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question