Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Create new user using IIS/ASP (http://www.velocityreviews.com/forums/t791606-create-new-user-using-iis-asp.html)

Ohaya 11-14-2003 06:11 PM

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!!

Ray at 11-14-2003 07:19 PM

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!!




Ohaya 11-14-2003 10:47 PM

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 10:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.