Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change AD User passwords via HTML?

Status
Not open for further replies.

mtucker6784

IS-IT--Management
May 12, 2008
1
US
Hi everyone, I work in the educational industry and we receive a lot of work orders asking for password resets. I've been working on my own html vbscript that will reset a designated user on My local machine (I'm testing as much as I can locally so I don't threaten compromising our AD system.) I created a user named "test" which I'm trying to manipulate. The problem is: It doesn't seem to successfully use GetObject to get the username from my computer. I do see my "[DEBUG] Attempting to find user" message, but nothing after that.

Here is the script I'm trying to use

<HTML>
<BODY>
<TITLE>x Password Change 0.1</TITLE>
<script language="VBScript">
dim variable , user
user = InputBox("Username?")
password = InputBox("Password?")
document.write("[DEBUG] Attempting to find " &user)
Set objUser = GetObject("WinNT://machine-name/ " &user)
document.write("[DEBUG] found user: " &user)
objUser.SetPassword " " &password
document.write("AJUSD Password change successful for user: " &user)
document.write("<br>")
document.write("Password was set to: " &password)
</script>
<a href=" here to go back to the ticket page</a>
</HTML>

I've tried taking out the &user variable after my GetObject command, just and just using: Set objUser = GetObject("WinNT://machine-name/test") but that doesn't work either

I know someone may laugh at me, but it's an honest attempt :( Any point in the right direction would be much appreciated! Thank you so much!

-MT
 
>[tt]Set objUser = GetObject("WinNT://machine-name/[highlight] [/highlight]" &user)[/tt]
The whitespace should never be there in the first place.

I would say, time is not right to tackle the functionality in a html page. The script at this present draft is seriously flawed that it is even hard to make right.
 
I would suggest you utilize ASP and vbscript for this. Further I would recommend you code this for the domain from the beginning and just use a test account so you don't mess up your AD.

The script repository has sample code for the vbscript code you need.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top