Re: question for DSQUERY experts

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Sumner Paine (sumnerp_at_comcast.net)
Date: 12/07/04


Date: Tue, 07 Dec 2004 10:14:00 -0800

I think I got it! I used:

dsquery user domainroot -Limit 0 | dsget user -ln -fn -dn -disabled |
find " no " > "c:\enabled users.txt"

Where's the best place for me to go to read up on these commands? They
seem very powerful and I'd like to be able to use them without coming to
usenet every time....

Jason Newman wrote:
> Sumner
>
> Have you tried the following where FQDN is testdomain.com:-
>
> dsquery user dc=testdomain,dc=com | dsget user -fn -ln -disabled | find "no"
>
> This may do the trick for you
>
> Jason Newman [MCSE]
>
> "Sumner Paine" wrote:
>
>
>>I'm not too familiar with any of these DS commands. Can you give me any
>>more specifics about how to use DSGET with DSQUERY?
>>
>>Also, is there a good site or book about using these commands? I've
>>already looked through Microsofts helpfiles and found them not too helpful.
>>
>>
>>Scott Napolitan [Microsoft] wrote:
>>
>>>You might want to try another pipe to DSGET user -fn -ln before you pipe it
>>>out to a text file.
>>>
>>>Legal Disclaimer:
>>>This posting is provided "AS IS" with no warranties, and confers no
>>>rights. Use of included script samples are subject to the terms
>>>specified at http://www.microsoft.com/info/cpyright.htm Please do not
>>>send e-mail directly to this alias. This alias is for newsgroup purposes
>>>only.
>>>
>>>"Sumner Paine" <sumnerp@comcast.net> wrote in message
>>>news:31jviaF3a8km2U1@individual.net...
>>>
>>>
>>>>I'm using a batch file with this DSQUERY command to report on enabled user
>>>>accounts:
>>>>
>>>>dsquery user domainroot -Limit 0 | dsget user -dn -disabled |find " no "
>>>>
>>>>
>>>>>"c:\Enabled Accounts.txt"
>>>>
>>>>Anyone know if it's possible to get the output in the format Last Name,
>>>>First Name?
>>>>
>>>>Thanks in advance!
>>>
>>>
>>>



Relevant Pages

  • Re: DSQuery / DSMod to add UPN
    ... >> Is there a way to do this using the DSQuery and DSMod commands? ... >> I have gon as far as adding the UPN suffix, ...
    (microsoft.public.windows.server.active_directory)
  • Re: question for DSQUERY experts
    ... I'm not too familiar with any of these DS commands. ... more specifics about how to use DSGET with DSQUERY? ... > send e-mail directly to this alias. ... >>I'm using a batch file with this DSQUERY command to report on enabled user ...
    (microsoft.public.windows.server.general)