Change Local Administrator Password script by passing variable from webpage

I am trying to make a very simple webpage were I can enter in a new password for the local administrator in a text box and click a button that sets a variable that I can use in a bat file.

How can I do this? Do not need to focus on the webpage part just the setting of the variable and passing it to a bat or vbs or something I can plug into.

Windows 2008 r2
Phase2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

x-menIT super heroCommented:
$password = "MyNewPassword"
$user = [ADSI]"WinNT://./Administrator"
$user.SetPassword($password)
$user.SetInfo()
0
x-menIT super heroCommented:
vbs:

strPassword = "MyNewPassword"
Set objUser = GetObject("WinNT://./Administrator,user")
objUser.SetPassword strPassword
objUser.SetInfo

0
Phase2Author Commented:
What is your first post? BAT file?

I need to set the $password variable from a webpage using perl,php,java,forms whatever.

then pass that variable into a vbs script or bat file or something I can make work to change the local administrator password.

not sure how to pass the variable into a seperate script file
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Phase2Author Commented:
So basically I have a webpage that looks like this. attached.
 passchange
My Form code is below. Also checks to make sure both entered passwords are the same.

How do I get the password entered in this webpage to a VBS script?
<form onSubmit="return checkPw(this)" name="cusfiles" method="get" action="changepassword.vbs">
	<table border=0 summary="Changepassword">
	<tr>
		<td>Password:</td><td><input type=password name=pw1 size=20></td>
	</tr>
	<tr>
		<td>Re-Enter:</td><td><input type=password name=pw2 size=20></td>
	</tr>
	<tr>
		<td colspan=2 align=center><input type=submit value="Submit"></td>
	</tr>
	</table>

Open in new window

0
x-menIT super heroCommented:
1st is powershell

...action="changepassword.ps1 pw1">..

where changepassword.ps1:

$password = $arg[0]
$user = [ADSI]"WinNT://./Administrator"
$user.SetPassword($password)
$user.SetInfo()


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
x-menIT super heroCommented:
2nd:

...action="changepassword.vbs pw1">

where changepassword.vbs:

trPassword = WScript.Arguments(0)
Set objUser = GetObject("WinNT://./Administrator,user")
objUser.SetPassword strPassword
objUser.SetInfo

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.