Unlocking and reenabling a local account on multiple machines

S

Simon

Hi guys!
Hope you can help.

I have a file containing a list of computer names.

Each computer has a local account called "admin01".
Through perl, Id like to check to see if the account is disabled, and locked
out, and if so, to unlock the account and reenable it.

I know how to write the script for connecting to machines and
authenticating, but getting stuck on the reenabling and unlocking the
accounts.

Thanks for any help.

S
 
T

Tad McClellan

Simon said:
Hi guys!
Hope you can help.


Not without knowing what operating system is managing the accounts we can't.

I have a file containing a list of computer names.

Each computer has a local account called "admin01".
Through perl, Id like to check to see if the account is disabled, and locked
out, and if so, to unlock the account and reenable it.


How would you do that without Perl? (ie. manually)
 
T

Thomas Kratz

Simon said:
Hi guys!
Hope you can help.

As Tad already mentioned, you should state the OS you seeking help for.

Anyway I'll take the liberty of assuming Win32. Of course I may be
wrong, your problem :)
I have a file containing a list of computer names.

Each computer has a local account called "admin01".
Through perl, Id like to check to see if the account is disabled, and locked
out, and if so, to unlock the account and reenable it.

I know how to write the script for connecting to machines and
authenticating, but getting stuck on the reenabling and unlocking the
accounts.

Have a look at Win32::Lanman::NetUserSetInfo. You have to reset
the UF_ACCOUNTDISABLE flag.

Or do it with ADSI through the Win32::OLE module.

You'll have to read the docs anyway.

Thomas

--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
 
S

Simon

Im running ActiveState Perl on Windows NT
Tad McClellan said:
Not without knowing what operating system is managing the accounts we
can't.




How would you do that without Perl? (ie. manually)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top