Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


PowerShell: Need Assistance in Querying Active Directory Attribute

Posted on 2012-08-15
Medium Priority
Last Modified: 2012-08-20
Windows Server 2008 R2
Lync Server 2010

Hey Experts, I'm hoping you can help me out.  I attempted to compile a short script to query a specific attribute in all AD user objects within a designated Lync Server OU.  I simply want to query the thumbnailPhoto attribute in each of these user objects and if possible, parse the data to CSV file, but only from the accounts that have an existing thumbnail.

Based on information I found, I attempted to accomplish this by using a Get-QADuser cmdlet, however, when I executed the command, PowerShell did not recognize the cmdlet.

Any help would be appreciated.
Question by:DrivelFree
LVL 57

Expert Comment

by:Mike Kline
ID: 38298568
You are using QADuser which is part of the Quest AD cmdlets.  You can download those for free


Here is an example I helped with using adfind (looking for thumbnailphoto)




Author Comment

ID: 38300134
Thanks for the quick response, Mike.  Unfortunately, I'm in a secured facility on a production server and can't download any third party applications.

There has to be a way to accomplish utlizing the AD module through PowerShell.

Accepted Solution

Brent Challis earned 2000 total points
ID: 38303319
Try using:
Get-ADUser -filter (-not (thumbnailPhoto -like "*"))
 to get a collection of all user objects that do not have  a thumbNail.

The Get-ADUser cmdlet also supports a SearchBase parameter if you want to specify a specific OU as the starting point.

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

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Screencast - Getting to Know the Pipeline

571 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