Information générale
Catégorie:
Applications Internet
Titre:
Creating users with adsi/asp
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement