Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strContainer = "ou=ouLanisAdmin, ou=Lanis"
- strName = "LanisSysOp"
- '***********************************************
- '* Connect to a container *
- '***********************************************
- Set objRootDSE = GetObject("LDAP://rootDSE")
- If strContainer = "" Then
- Set objContainer = GetObject("LDAP://" & _
- objRootDSE.Get("defaultNamingContext"))
- Else
- Set objContainer = GetObject("LDAP://" & strContainer & "," & _
- objRootDSE.Get("defaultNamingContext"))
- End If
- '***********************************************
- '* End connect to a container *
- '***********************************************
- Set objUser = objContainer.Create("user", "cn=" & strName)
- objUser.Put "sAMAccountName", strName
- objUser.SetInfo
- objUser.SetPassword = "gi1"
- objUser.LoginScript = "lanissysop.bat"
- objUser.AccountDisabled = False
- objUser.SetInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement