![]() |
Create new user using IIS/ASP
Hi,
I'm running IIS5 on a Win2K server, and I want to have an ASP page that creates new users. I have some simple code to test this, but am getting a "500" error when I run it. The ASP looks like: <% strDomain ="Foo.com" strUser ="Foo1" ' Create new user with password Set oDomain = GetObject("WinNT://" & strDomain) Set oUser = oDomain.Create ("User", strUser) oUser.SetPassword = "password" oUser.SetInfo %> Just for this testing, I've added IUSR_machinename to the Administrators group, but am still getting the 500 error. Can anyone tell me what I'm doing wrong here??? Thanks in advance!! |
Re: Create new user using IIS/ASP
Try using:
oUser.SetPassword "password" ..SetPassword is a method that requires an argument. You're trying to treat it as a property. That's my interpretation, anyway! Also, http://www.aspfaq.com/2109 Ray at work "Ohaya" <ohaya@NO_SPAM.cox.net> wrote in message news:3FB51ABA.29565DFA@NO_SPAM.cox.net... > Hi, > > I'm running IIS5 on a Win2K server, and I want to have an ASP page that > creates new users. I have some simple code to test this, but am getting > a "500" error when I run it. > > The ASP looks like: > > <% > > strDomain ="Foo.com" > strUser ="Foo1" > > ' Create new user with password > Set oDomain = GetObject("WinNT://" & strDomain) > Set oUser = oDomain.Create ("User", strUser) > oUser.SetPassword = "password" > oUser.SetInfo > %> > > Just for this testing, I've added IUSR_machinename to the Administrators > group, but am still getting the 500 error. > > Can anyone tell me what I'm doing wrong here??? > > Thanks in advance!! |
Re: Create new user using IIS/ASP
Ray,
HOORAY!!!! That worked great!! Thanks a lot! (Did I include enough exclamation points in this post :)?) Jim "Ray at <%=sLocation%>" wrote: > > Try using: > > oUser.SetPassword "password" > > .SetPassword is a method that requires an argument. You're trying to treat > it as a property. That's my interpretation, anyway! > > Also, http://www.aspfaq.com/2109 > > Ray at work > > "Ohaya" <ohaya@NO_SPAM.cox.net> wrote in message > news:3FB51ABA.29565DFA@NO_SPAM.cox.net... > > Hi, > > > > I'm running IIS5 on a Win2K server, and I want to have an ASP page that > > creates new users. I have some simple code to test this, but am getting > > a "500" error when I run it. > > > > The ASP looks like: > > > > <% > > > > strDomain ="Foo.com" > > strUser ="Foo1" > > > > ' Create new user with password > > Set oDomain = GetObject("WinNT://" & strDomain) > > Set oUser = oDomain.Create ("User", strUser) > > oUser.SetPassword = "password" > > oUser.SetInfo > > %> > > > > Just for this testing, I've added IUSR_machinename to the Administrators > > group, but am still getting the 500 error. > > > > Can anyone tell me what I'm doing wrong here??? > > > > Thanks in advance!! |
| All times are GMT. The time now is 05:13 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.