Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

PowerShell - update "Manager"?

Posted on 2011-10-25
4
Medium Priority
?
876 Views
Last Modified: 2012-05-12
I've been looking into some PowerShell scripts for AD, as well as some of Quest ActiveRoles cmdlets, but am not sure how I could do something like this.

Can you update a user's Manager/Direct Report (see AD properties > organization > manager) with a command? And could you also read the names from a text file and update the Manager name for each person (per line)?
0
Comment
Question by:garryshape
  • 2
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
Adam Brown earned 2000 total points
ID: 37028485
Sure. Create a csv file with the following headings and put the username in the first heading and the manager's username in the second.

Username,Manager

Then run the attached command in Quest AD
import-csv | foreach{$user,$manager = $_.username,$_.manager
set-qaduer -identity $user -manager $manager}

Open in new window

0
 

Author Comment

by:garryshape
ID: 37028881
Cool thanks a lot.

So if I wanted to do it for a single user, would it be:
Set-QADUser -identity JDoe -manager RDoe (to make RDoe the manager of JDoe)?

Open in new window

0
 
LVL 44

Expert Comment

by:Adam Brown
ID: 37029032
Pretty much, yes.
0
 

Author Closing Comment

by:garryshape
ID: 37031805
Thank you dear friend
0

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

Question has a verified solution.

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

A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses

571 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