Connecting Tech Pros Worldwide Help | Site Map

IIS6 set password in AD from external webserver via asp

Newbie
 
Join Date: May 2007
Posts: 1
#1: May 9 '07
Hey there,

I have a little puzzle that I am trying to solve. I would like to set a user's password in AD (2003) from an external (i.e. non-domain member) webserver (2003/IIS6) via an .asp page. The page itself consists of nothing more than vbs code. If I run the code as a stand-alone vbscript from the command line, it completes successfully; however, when executed from the .asp page I get:


Microsoft VBScript runtime error '800a0046'

Permission denied

/setpass.asp, line 62

This error occurs at the line where I set the password:

Expand|Select|Wrap|Line Numbers
  1.     Set objprovider = GetObject("LDAP:") 
  2.     Set objuser = objprovider.OpenDSObject(userid, binddn, bindpw, ADS_SECURE_AUTHENTICATION)
  3.     objuser.Put "Description","something something" 
  4.     objuser.SetPassword "P@ssw0rd"
  5.     objuser.SetInfo
  6.  
If I use WinNT provider (with corresponding parameters) the thing works as expected, so, yes, I do have a solution. However, I prefer to use the LDAP provider and I just can't stand not knowing why or how it doesn't work.

Again, when I run this code as a vbscript from the W2003 webserver it runs just fine. When I request the same .asp page from Windows XP Pro w/IIS5 (also non-domain member) I also get the desired result.

Obviously, the problem lies somewhere in OS/IIS version (2003/IIS6 vs. XP/IIS5), but how to fix it? And why does the code run fine as vbs and not as asp? I must be missing something... I have run network monitor to see what kind of traffic is generated and I noticed that on XP there is traffic on port 389 and 445 (SetPassword); on 2003 I only see traffic on port 389. But why? Have been searching the web endlessly but still haven't found what I'm looking for.
Any ideas or suggestions?
Thanks,

Rudi
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: May 10 '07

re: IIS6 set password in AD from external webserver via asp


I don't believe that you have an OS/IIS prob, you are not being granted permission from your asp page.
Newbie
 
Join Date: Aug 2007
Posts: 1
#3: Aug 16 '07

re: IIS6 set password in AD from external webserver via asp


Hi,

You can create a new application pool in IIS and set the Identity setting with the local system or with an admin user. You would use the setpassword command.

Bye

Christian
Newbie
 
Join Date: Feb 2008
Posts: 1
#4: Feb 26 '08

re: IIS6 set password in AD from external webserver via asp


Was there ever a solid solution to this problem? I'm having the same problem.

I tried to create a new AppPool, but that didn't work either. Would love to get this one finished.
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#5: Feb 27 '08

re: IIS6 set password in AD from external webserver via asp


Quote:

Originally Posted by twinders

Was there ever a solid solution to this problem? I'm having the same problem.

I tried to create a new AppPool, but that didn't work either. Would love to get this one finished.

Not sure if there was. The secure authentication may be leading to the permissions error. If this was asp.net, I might try impersonation.
Reply


Similar IIS / Microsoft Internet Information Services bytes