+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, PS AD Search for Users withl Blank Pager Field in Coding and Web Development; I'm trying to create a script to return a list of users that have an empty pager field. I've tried ...
  1. #1

    Join Date
    Mar 2013
    Location
    Northampton
    Posts
    96
    Thank Post
    16
    Thanked 25 Times in 17 Posts
    Rep Power
    8

    PS AD Search for Users withl Blank Pager Field

    I'm trying to create a script to return a list of users that have an empty pager field.

    I've tried using the following:
    Code:
    Get-ADuser -filter {(pager -notlike "*")} | Select-Object givenname,surname,pager
    Which returns a list of users with nothing under pager. Now that looks like the result I need but I then double checked with a query of all users with something in the pager field.
    Code:
    Get-ADuser -filter {(pager -like "*")} | Select-Object givenname,surname,pager
    This returns a list of users still with nothing under the pager field.
    No matter what I do I can't get anything under the pager field. I've tried with an LDAPfilter using pager and Phone-Pager-Primary. I'm pretty sure I haven't been using the correct attribute name.

    Any help would be greatly appreciated.

  2. #2


    Join Date
    Dec 2005
    Location
    In the server room, with the lead pipe.
    Posts
    4,652
    Thank Post
    275
    Thanked 780 Times in 607 Posts
    Rep Power
    224
    I assume you mean "though the query is returning the correct users (with something in the pager field), it's not printing the value of the pager field", correct?

    By default, Get-ADUser Bob (for example) only returns a brief amount of into which doesn't include the pager field. Since you're not asking for the info, it'll never be printed in your results. Get-ADUser -Properities * Bob would return all the info about Bob. Get-ADUser -Properties pager Bob would return brief info about Bob including his pager value (if populated).

    Code:
    Get-ADuser -Properties pager -filter {(pager -like "*")} | Select-Object givenname,surname,pager

  3. #3

    Join Date
    Mar 2013
    Location
    Northampton
    Posts
    96
    Thank Post
    16
    Thanked 25 Times in 17 Posts
    Rep Power
    8
    That works great. Thanks for the help, pete.

SHARE:
+ Post New Thread

Similar Threads

  1. Searching AD for users with a specific UPN, how?
    By mrbios in forum Windows Server 2008 R2
    Replies: 2
    Last Post: 26th November 2013, 09:06 AM
  2. Adding printer for users in domain
    By brickwall53 in forum Windows Server 2008 R2
    Replies: 11
    Last Post: 1st July 2011, 10:30 AM
  3. How to search for common posts by 2 users
    By SimpleSi in forum General Chat
    Replies: 5
    Last Post: 30th November 2010, 01:20 PM
  4. Ad Infinitum file format for user creation?
    By tazz in forum How do you do....it?
    Replies: 1
    Last Post: 28th August 2009, 05:26 PM
  5. Sharepoint - Hide search for certain users/groups
    By bmdixon in forum Virtual Learning Platforms
    Replies: 1
    Last Post: 3rd December 2008, 12:07 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •