Unlocking and reenabling a local account on multiple machines

Discussion in 'Perl Misc' started by Simon, Jul 2, 2007.

  1. Simon

    Simon Guest

    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
     
    Simon, Jul 2, 2007
    #1
    1. Advertising

  2. Simon <> wrote:
    > 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)


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Tad McClellan, Jul 2, 2007
    #2
    1. Advertising

  3. Simon

    Thomas Kratz Guest

    Simon wrote:
    > 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^.-
     
    Thomas Kratz, Jul 2, 2007
    #3
  4. Simon

    Simon Guest

    Im running ActiveState Perl on Windows NT
    "Tad McClellan" <> wrote in message
    news:...
    > Simon <> wrote:
    >> 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)
    >
    >
    > --
    > Tad McClellan
    > email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Simon, Jul 2, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3VuZGFyYXJhamFu?=

    Unlocking db objects in Session end

    =?Utf-8?B?U3VuZGFyYXJhamFu?=, Jul 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    378
    Andy Fish
    Jul 22, 2005
  2. schwerdy
    Replies:
    1
    Views:
    385
    Terry Reedy
    Nov 10, 2004
  3. Chad Dressler
    Replies:
    0
    Views:
    674
    Chad Dressler
    Dec 30, 2006
  4. NaeiKinDus
    Replies:
    1
    Views:
    606
    Jack Klein
    Apr 14, 2007
  5. NaeiKinDus
    Replies:
    3
    Views:
    641
    James Kanze
    Apr 15, 2007
Loading...

Share This Page