Hi, I'm porting a vbscript to asp.net and have this remote password reset tool working only if I'm logged into the computer and running it from there. If I access the page from a different box it fails to bind to another workstation. Basically, the program loops through a text file with computer names and resets the administrator account. I'm logging in with impersonate and windows authentication that has rights to reset the administrator account. It works great when rdp'd into the web server but not from my desktop. The security logs on the remote pc's whose password I'm trying to reset shows successfull anonymous access but not account change. I'm sure that the program is using the account that has admin privleges but it seems that it's not using that acct. to bind to the pc's and reset the admin acct.
web config file snippet
<authentication mode="Windows"/>
<
identity impersonate = "true" />
partial reset code
Do Until serverlist.EndOfStream
'assign the variable host to represent a line in the text file, which is a server
Try
host = serverlist.ReadLine
CatchLogfile.WriteLine("error reading serverlist.txt file, " & Date.Now)
lblUploadStatus.Text =
"Error reading serverlist.txt file, check the file"
Exit Sub
End Try
'bind with adsi to the user account on the server
Tryuser = GetObject("WinNT://" & host & "/" & useraccount)
Logfile.WriteLine(host &
",success," & Date.Now)Catch ex As System.Exception
'MsgBox("An exception occurred:" & " for " & host & vbCrLf & ex.Message)Logfile.WriteLine(host & ", failure," & ex.Message & "," & Date.Now)
End Try
'change the password to the new password
Try
user.SetPassword(confirmpassword)
Catch ex As Exception
'Logfile.WriteLine(host & ", change password failure," & Date.Now)
End Try
'confirm the password change
Try
user.SetInfo()
'Logfile.WriteLine(host & ", set password success," & Date.Now)
Catch
'Logfile.WriteLine(host & ", set password failure," & Date.Now)
End Try