Searching AD with a bat file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
d4rren87
Posts: 2
Joined: 28 Jun 2012 10:22

Searching AD with a bat file

#1 Post by d4rren87 » 28 Jun 2012 10:27

Hi

OK I will start by giving you the scenario

We have a call centre with Team leaders and management, and then call centre staff.

I have created the following script as per below and
this works OK.


@echo off

SET /P usr=Please type the username you wish to reset:
net user %usr% * /domain /Active:yes


pause


However I need this so people can search names within AD rather than having to get the username correct.

ie, at the moment the person has to type jsmith, I want to be able to do john smith then it finds the user to reset the password.

Please email back.

d4rren87
Posts: 2
Joined: 28 Jun 2012 10:22

Re: Searching AD with a bat file

#2 Post by d4rren87 » 28 Jun 2012 10:31

Sorry guys This also needs to create a log file showing the date and time of who changed the password, and also the username of who did it.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Searching AD with a bat file

#3 Post by Squashman » 29 Jun 2012 07:19

I haven't worked wit AD in a few years but I think DSquery can do what you want. If not give one of Joe's tools a try.
http://www.joeware.net/freetools/

Post Reply