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

Punkrulz

Somewhat eXPerienced
Joined
Dec 24, 2001
Messages
790
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.
 

fitz

Woah.. I'm still here?
Staff member
Political User
Joined
Apr 26, 2004
Messages
4,084
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.
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


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.
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:
Code:
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:

Punkrulz

Somewhat eXPerienced
Joined
Dec 24, 2001
Messages
790
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?
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]

fitz said:
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:
Code:
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.
I shall take a look at this, and see if it is a feasible option. Thank you!
 

Members online

No members online now.

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Hey ep!

All good with me, applying for microsoft mvp right now, should have done this a while ago.

Notifications don't work, I only found your response by comming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier, mine is perriscalderon at gmail
Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...

Forum statistics

Threads
61,975
Messages
673,270
Members
89,047
Latest member
hargadetocline