Solved

Get pager number from Active Directory based on fax list

Posted on 2013-01-02
1
764 Views
Last Modified: 2013-02-04
I have a raw list of fax numbers in a text file.  These fax numbers are all assigned to Active Directory users.  I'd like to use this list of fax numbers to build an AD query that will glean the following info....for each fax number, i need to know the matching SAMAccount name, display name, and most importantly, the pager field value.

I'm fairly new to powershell scripting, but this seems like something that should be easy to accomplish.  I have the Quest Active Roles management shell installed.  I was thinking I could run a get-qaduser command and combine it with for-each or perhaps use an ldap filter, however, I'm still a bit fuzzy on how the syntax would work out.  Please forgive my inexperience with this.
0
Comment
Question by:patriots
[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 39

Accepted Solution

by:
Krzysztof Pytko earned 500 total points
ID: 38736789
Just simply try this code in Quest powerShell
get-content c:\faxes.txt | %{ Get-QADUser -Fax $_ | Select sAMAccountName,DisplayName,Pager } | Export-CSV c:\users.csv

Open in new window


Regards,
Krzysztof
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  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

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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