Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating users with adsi/asp
Message
From
04/04/2000 08:42:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Creating users with adsi/asp
Miscellaneous
Thread ID:
00354900
Message ID:
00354900
Views:
62
Hello:

I'm trying to test Active Directory Services Interface with ASP to create users/passswords etc. on NT.

I 'm using the Backup Domain Controller and I get an error that "This operation is only allowed on the PDC." I'm using samples out of the ADSI/ASP Programmers Reference Book.

I thought I could do this on BDC as well. Anyone know how I can get around this without using the PDC? I'd appreciate any input or comments. Thanks.

Sheena


Here is some of the code for my asp page.
@ Language=VBScript

INCLUDE File=c:\.../Common/Functions.inc

dim ComputerObj
dim Username
dim Fullname
dim Password
dim lcDescription
dim Newuser
dim Descript

On error Resume Next
Username = "Testuser"
Fullname = "Mr. Test User, Jr."
Descript = "This is a Test User"
Password = "password"

Set Computerobj = Getobject("WinNT://IMWEBSHEENA")
If Err Then adsierr()
Create a New User on <%= ComputerObj.Name %>

Set NewUser = ComputerObj.Create("User", Username)
Newuser.Setinfo
if Err Then adsiErr()
Response.Write "Creating User:
" & NewUser.Name & "...
"

Newuser.SetPassword(Password)
Response.Write "Setting Passwoord...
"

Newuser.Fullname(Fullname)
Response.Write "Setting Fullname...
"

Newuser.Description = Descript
Response.Write "Setting Description...
"

NewUser.Setinfo
If Err Then adsiErr()
Response.Write "Done!
"
Reply
Map
View

Click here to load this message in the networking platform