nav2567
asked on
query Windows 2003 account status
I have a txt file which lists about 300 entries of samids. Is there a way I can display the status of the samid (Active or Disable) and the samid itself?
We have WIN2003 AD environment.
Many Thanks.
We have WIN2003 AD environment.
Many Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try this;
dsquery user -disabled -limit 0 | dsget user -samid > c:\disabledusers.txt
dsquery user -disabled -limit 0 | dsget user -samid > c:\disabledusers.txt
For active users only try
dsquery * -filter "(&(objectCategory=person) (objectCla ss=user)(! userAccoun tControl:1 .2.840.113 556.1.4.80 3:=2))" > c:\domainusers.txt
copy and past this to a notepad first to take out the wraparound
dsquery * -filter "(&(objectCategory=person)
copy and past this to a notepad first to take out the wraparound
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot everyone.
ASKER
Can the above display a list of samids?
I am not good at VB. Do you know how to put them together using dsquery & dsget? I tried but not successful.