Solved

Active DirectoryScript to change the Pager Field

Posted on 2016-11-23
1
95 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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