madurham Posted April 14, 2014 Posted April 14, 2014 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: 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. 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.
pete Posted April 14, 2014 Posted April 14, 2014 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). Get-ADuser -Properties pager -filter {(pager -like "*")} | Select-Object givenname,surname,pager
madurham Posted April 14, 2014 Author Posted April 14, 2014 That works great. Thanks for the help, pete.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now