VBScript, 1 to apply registry changes, another to change admin pass

Discussion in 'Web Design & Coding' started by Punkrulz, Dec 11, 2006.

  1. Punkrulz

    Punkrulz Somewhat eXPerienced

    Woodbury, NJ
    Hey guys,

    I believe I just need 2 more scripts and I think I am going to be golden. Can someone either point me into the right direction, or post me sample scripts that I can use to apply to my situation???

    Script 1:
    I need a script that will do the following;
    1) Apply registry settings specified in a file that I select to the computers the script runs on.
    2) After applying those registry settings, I need the script to move the computers from their existing user group, to another of my choice. This ensures that the script only runs once on the computers, as well as tells me what computers have had the registry settings applied to it.

    Script 2:
    I need a logon script that will change the Local Administrator password to that of my liking. Most of the computers are already set to the password that I want, however there are some out there that have an administrator password neither myself nor my co-worker know of what it is.
  2. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Why is it such a big deal if it runs only once? What happens when after you move the computer, the user goes back in and changes the registry to something else?

    In any case, this link should point you in the right direction for reading/writing registry keys. I'm not feeling very motivated to write one myself

    Checking computer group memberships is a matter of binding to AD and pulling the group info. and running your if/then matches on the collection that is returned. Examples here or here

    I would recommend against setting the local admin password via a login script. Login scripts in a domain environment sit on the netlogon share which is world readable.. which means your plain-text vbs/bat/cmd file is readable as well.

    Better to write a standard batch file and use a utility like PsPassword and feed a for loop a list of computer names to get it done remotely

    or create a batch file using the net user command:
    net user Administrator <passwordhere>
    and use it in combination with something like psexec and again run it through a for loop to remotely change all the Administrator passwords.
    Last edited: Dec 11, 2006
  3. Punkrulz

    Punkrulz Somewhat eXPerienced

    Woodbury, NJ
    Well, I don't necessarily think it is a problem if it runs more than once, however I just want to kind of cancel all unnecessary script runs and if the script ran everytime the computer was restarted, that would be kind of pointless.

    Also, users are in a limited environment, and don't have the ability to go into the registry and change things at will... and also user experience, there is only a small handful of "computer people" that may even know what the registry is. Fortunately however as I previously stated, they're in a limited environment.[/quote]

    I shall take a look at this, and see if it is a feasible option. Thank you!