Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pipe in entries to DSQUERY from CSV file? 1

Status
Not open for further replies.

wlfpackr

IS-IT--Management
May 3, 2003
161
0
0
US
Is it possible to use a CSV or text file in conjunction with a DSQUERY or a DSMOD? i.e. Let's say I have a list of user IDs in a text file and I want to check and see if each one in the file is enabled using a DS commands.

I can do it in VBscript, but I'm looking for a quicker way.



=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
Here's the command...

for /f %a in (input.txt) do dsquery user -samid %a | dsget user -disabled -samid >> output.txt

input.txt is a file with one username per line. output.txt will contain the resulting data.

PSC
[—] CCNP[sub][blue]x3[/blue][/sub] (Security/R&S/Wireless) [•] MCITP: Enterprise Admin [•] MCSE [—]

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --from "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top