Embed username and password into script

Discussion in 'Scripting' started by Lisa, Nov 5, 2003.

  1. Lisa

    Lisa Guest

    Hello,

    Sorry about the newbie question. I'm rather new to
    scripting and couldn't find a solution in the Script
    Centre.

    I need a way to allow a user to unlock another user
    account on a stand alone WinXP Pro machine.

    I stuck two scripts together to get one that unlocked an
    account, however I'm not sure how to get a normal user to
    have the privilege to run it:

    strComputer = "ComputerName"
    Set objUser = GetObject("WinNT://" & strComputer & "/User")
    objUser.IsAccountLocked = False
    objUser.SetInfo

    I was hoping to be able to use RunAs with Sanur.exe (found
    a link in this NG), however I believe that RunAs only
    works for .exes, .mmc etc, but not .vbs.

    I have also thought of embedding it into a .bat file and
    using SU.exe however that also has problems.

    So, is there anyway I can embed a Username and Password of
    an account that has permission to unlock another account
    and run a .vbs file INTO the .vbs script?

    I hope all this makes sense!

    Thanks in advance,

    Lisa
     
    Lisa, Nov 5, 2003
    #1
    1. Advertisements

  2. I was hoping to be able to use RunAs with Sanur.exe (found
    Cscript.exe and wscript.exe are executables. So, you can use RunAs:
    cscript.exe your_script.vbs.

    Regards,

    Vedran
     
    Vedran Matica, Nov 5, 2003
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.