ADSI authentication issues
Well, if I'm going to be the first to post to this board, I might as well post a head-scratcher. When I try to add a new Windows user via ADSI, I get the always wonderful "General Access Denied" error. I've seen various tidbits about authentication, though I can't seem to get it to work properly. Here's the code I'm using:
Set AuthUser = GetObject("WinNT:")
Set Domain = AuthUser.OpenDSObject("WinNT://server", "server\IUSR_SERVER", "password$", ADS_AUTHENTICATION_SECURE)
Response.Write (Request.ServerVariables("AUTH_USER") & "<br>")
wUsername = user_name
wDescription = "XG2003 User"
wPassword = password
Set myComputer = GetObject("WinNT://" & computer_name)
' Create the new user account
Set newUser = myComputer.Create("User", wUsername)
newUser.SetInfo
' Set properties in the new user account
newUser.SetPassword wPassword
newUser.FullName = wUsername
newUser.Description = wDescription
UF_DONT_EXPIRE_PASSWD = &H010000
UF_PASSWD_CANT_CHANGE = &H000040
newUser.UserFlags = newUser.UserFlags or UF_DONT_EXPIRE_PASSWD or UF_PASSWD_CANT_CHANGE
newUser.SetInfo
You'll notice that I'm printing the AUTH_USER variable, just out of curiosity. Curiously, it returns nothing. It's empty. And no one can seem to figure out why. Now, can anyone tell me why my code doesn't work and/or why AUTH_USER doesn't seem to have anything in it? If anyone can solve this mystery they've worked a small miracle. Thanks in advance for your help.
IZA
|