Solved

Powershell - Setting the memberof attribute

Posted on 2010-11-23
3
1,563 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
  • 2
3 Comments
 
LVL 27

Accepted Solution

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

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

Author Comment

by:Adam Brown
Comment Utility
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
Comment Utility
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now