PowerShell: Need Assistance in Querying Active Directory Attribute

Posted on 2012-08-15
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
    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)


    LVL 1

    Author Comment

    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.
    LVL 8

    Accepted Solution

    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
    This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now