Solved

Active DirectoryScript to change the Pager Field

Posted on 2016-11-23
1
13 Views
Last Modified: 2016-12-01
We use the Pager field as a reference for an internal process.  We need to now update the field with a new set of numbers.

Each user has a unique pre determined number.
The root user AD OU is OU=MyUsers,DC=company,DC=com
We have a mapping in a csv.  Not all user will get a PagerID, only the one in the files. Also it must replace (not merge) the PagerID field with new mapping.
Can
Usernames      PagerIDs
User1            12345
User2            12346
User3            12347


Is there Batch script that will to the following?
0
Comment
Question by:GGHC
1 Comment
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
Powershell can do it easily:
Import-Module ActiveDirectory
Import-Csv C:\Temp\pager.csv | % {Set-ADUser -Identity $_.UserNames -Replace @{'pager' = $_.PagerIDs}}

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

11 Experts available now in Live!

Get 1:1 Help Now