Solved

Active DirectoryScript to change the Pager Field

Posted on 2016-11-23
1
76 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 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 41899095
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

808 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