Need to test for correct admin password

October 17, 2011 at 08:53:28
Specs: Windows XP
Good day all, I am working in a domain environment with multiple domains as well as multiple local admin account passwords. Good thing is, I only need info regarding the local admin accounts.

What I need to do is, on XP Pro machines, determine which 1 out of 4 passwords is being used for the local admin account.

ie - Local admin account name - roscoe
Possible admin passwords - Password1, or Password2, or Password3, or Password4.

What I need to happen is, for the batch to check, attempt to authenticate, or whatever, password #1 and if it fails to go try the second one and so-on until it gets a success, then store the successful one as a variable that I can use in other parts of the batch.

Can anyone give me a shove in the right direction?

See More: Need to test for correct admin password

Report •

October 17, 2011 at 12:25:34
Ok, I've gotten this much....

net use \\computername\IPC$ /user:computername\Administrator password

So if I get an exit code of 0, that means that password was correct.

Last part of the equation is, storing that particular password as a variable for use later......

Report •

October 17, 2011 at 13:09:49
Well..... Roadblock #1. :)

It seems that the local admin accounts do not have the ability to "logon" via the net use command, so here's what I have learned.

Using the command given I get 2 different results.

1) Error 1326 - Bad username or password. (When PW is incorrect)

2) Error 1385 - User has not been granted the requested logon type. (When PW is correct)

Unfortunately, both errors generate an exit code of 2 so errorlevel isn't being much help... :(

Is there anything anyone can add to this to help me along?

Report •

October 18, 2011 at 00:51:55
Try with the runas command?

runas/user:USER PASSWORD calc.exe

Happy is ONE who says I am an OttoMAN.

Report •

Related Solutions

Ask Question