How to update Manager Attribute in Active Directory for Bulk users

Couple of days ago I was asked to make some AD bulk change.

A list of users that is currently residing in different OU’s have a particular manager. This manager has left the organisation. I know have to change the manager of this users to a new managers.

 

This bulk work is done via powershell AD-user module.

Open a powershell module from a Domain controller. And perform below

 

First, get –ad user then filter to their current managers name and then set new manager

 

Below is the command I used, Do not use full name of the managers, instead use the user name of the managers

Get-adusers –filter “manager –eq ‘username’” | set-aduser –manager username –passthru | get-aduser –properties title,manager | select name,title,manager

PSh1

As you can see, I am changing all the users managers from “ekrassas” to “dcareymunro. The passthru command is to force the change and the rest of the command is to display the newly applied changes.

Leave a Reply

Your email address will not be published. Required fields are marked *