Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating users with adsi/asp
Message
De
04/04/2000 08:42:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Creating users with adsi/asp
Divers
Thread ID:
00354900
Message ID:
00354900
Vues:
67
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!
"
Répondre
Fil
Voir

Click here to load this message in the networking platform