DSQUERY | DSGET filtered for null field result

Posted on 2006-06-03
Last Modified: 2012-08-14
I have been using the DS tools for about 6 months and have finally run into a simple problem, upon which I am sure someone can shed light...

I use the following command to show users and their profile paths by Distinguished Name.

dsquery user -name * | dsget user -profile -dn

NOW, I need to filter this output to show only those folks with no entries in their profile path.

This would be the quickest way to output those users for whom we have not migrated from NDS 6.0 profiles to AD profiles. I need to do a quick check to see if we have accounted for everyone using this method.

Any ideas how to filter for <NULL> using DS tools? This is the crux of this question. If there is no way, I will write a WSH script and be done with it.
Question by:johndarby
    LVL 15

    Expert Comment

    I don't think that you can, but you can pipe the output to a CSV file, open it in excel and sort the output based on the profile column. That'll group the users that don't have a profile path.
    LVL 4

    Accepted Solution

    You should use a Saved Query for this. Create a new query, name it something, Press Define Query button, Select Custom Search from Find drop down box, Click on advanced button and paste the following:


    This query will find all users that are not disabled and do not have anything in profile path.

    Hope this works for you.
    LVL 4

    Expert Comment

    I forgot to mention that the saved query is created in Active Directory Users and Computers. (Just in case someone does not know where to do this :))
    LVL 1

    Author Comment

    Thanks Darwinian.

    Thanks Imran, I awarded you points since you offered an alternative. I am in the process of writing a VBS script which I will use AT scheduler to run every 24 hours. This output will be automatically emailed to NDS -> AD Migration Coordinator.

    Thanks again,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    It is a known fact that servers reach the end of their lives. Some get there quicker than others, based on age, manufacturer, usage and several other factors. However, if your organization has spent time deploying Microsoft's Active Directory server…
    Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 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

    12 Experts available now in Live!

    Get 1:1 Help Now