Link to home
Start Free TrialLog in
Avatar of every1isevil2
every1isevil2Flag for United States of America

asked on

DSQUERY FOR USERS

I need a script that does the following:

-Generate a list of all users my domain and save to a text file
-It must NOT list the user account that have been disabled

I am not too concerned with how pretty the output file looks as I will use Excel to import it into a workbook.  So the following format is ok:
"CN=Charles Ross,CN=Users,DC=mogan,DC=local"

Open in new window

Avatar of MightySW
MightySW
Flag of United States of America image

Hi, you will need an AD export script.

Try this site:

http://www.visualbasicscript.com/m_29830/tm.htm

Copy the text and then save it as a .vbs file

They have a great example that will go to excel.

HTH
Wow, I just tried this.  It is AWESOME!  It will do everything you ask and more.  You can edit the fields as necessary.
Ok, I see you have the disabled disclaimer in there.  Let me see what I can do.
Avatar of every1isevil2

ASKER

Thank you for the fast reply.

After looking at the code, which is quite nice, I am afraid that it does not meet either of my requirements.  I need it to send it to: a) text file and b) leave out disabled user accounts.

Please submit syntax/code.
ASKER CERTIFIED SOLUTION
Avatar of MightySW
MightySW
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Its actually set for stalepassword of 0, so it will get everybody.