• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

Change User Passwords in AD from an Excel List

I need the ability to reset multiple user's passwords using unique predefined passwords. I would like to be able to have one column for the user's user name and the other the password needed to be changed too.

It needs to look like:

Username:        Password:
ABC                   123
DEF                    456

If i could get PowerShell or VB to read from this that would be awesome.

Thanks for you help. It is greatly appreciated.            
0
bjohnson_MN
Asked:
bjohnson_MN
1 Solution
 
Todd GerbertIT ConsultantCommented:
Put usersnames and password in a text file, separated by a comma, use command line:

for /F "tokens=1,2 delims=," %i in (yourfile.txt) do net user %i %j /domain
0
 
bjohnson_MNAuthor Commented:
I get an error saying C:\test.txt was unexpected at this time. Any thoughts??
0
 
Todd GerbertIT ConsultantCommented:
This is executed at a command prompt, it's not VBScript.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
bjohnson_MNAuthor Commented:
Yeah I tried it at the command prompt. It will not read my text file and kicks back the "C:\test.txt was unexpected at this time"  The output is below.

C:\Users\showard>for /F "tokens=1,2 delims=," %i in "C:\test.txt" do net user %i
 %j /domain
"C:\test.txt" was unexpected at this time.

0
 
Todd GerbertIT ConsultantCommented:
You need the parentheses.

for /F "tokens=1,2 delims=," %i in (C:\test.txt) do net user %i %j /domain
0
 
cj_1969Commented:
what OS are you running?
I created a test file (by another name) and tried the command as is and it works.
As long as you have permissions to execute the command ... you would have to ahve the appropriate admin rights to do a password change.

Hmmm ... are you working on a machine that is in an AD domain?  If not, and you are working with local accounts, try leaving off the /domain reference at the end of the command.  Another difference in what I tried.
0
 
bjohnson_MNAuthor Commented:
It works. I thought you didn't need the parentheses but I guess you do. Thank you so much for the quick response. It is greatly appreciated.

0
 
bjohnson_MNAuthor Commented:
Thank you so much. In 10 minutes you solved my 2 hours of frustration with VB. You are a God send.
0
 
RoadAngelCommented:
Hi There... this is exactly what I have been looking for but I get the error message befoer the file name:

C:\>for /F "tokens=, delims=,"%i in "1.txt" do net user %i %j /domain
in was unexpected at this time.

I am running this command logged on as a domain administrator and have verified access to ADUC whilst logged onto a domain controller.

Any ideas?

Thanks
0
 
Todd GerbertIT ConsultantCommented:
You need to put your filename in parentheses, not quotes.  Check "for /?" for all the nitty gritty details on syntax, and you should consider asking your own question if you run into any issues beyond this.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now