Solved

Active DirectoryScript to change the Pager Field

Posted on 2016-11-23
1
48 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 83

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide local printer for some users (GPO) 2 23
Copy the files from the share to network PCs 4 27
AD lockouts-AdAudit Plus 7 30
xcopy loop 13 37
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

911 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

18 Experts available now in Live!

Get 1:1 Help Now