Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. strContainer = "ou=ouLanisAdmin, ou=Lanis"
  2. strName = "LanisSysOp"
  3.  
  4. '***********************************************
  5. '* Connect to a container *
  6. '***********************************************
  7. Set objRootDSE = GetObject("LDAP://rootDSE")
  8. If strContainer = "" Then
  9. Set objContainer = GetObject("LDAP://" & _
  10. objRootDSE.Get("defaultNamingContext"))
  11. Else
  12. Set objContainer = GetObject("LDAP://" & strContainer & "," & _
  13. objRootDSE.Get("defaultNamingContext"))
  14. End If
  15. '***********************************************
  16. '* End connect to a container *
  17. '***********************************************
  18.  
  19. Set objUser = objContainer.Create("user", "cn=" & strName)
  20. objUser.Put "sAMAccountName", strName
  21. objUser.SetInfo
  22. objUser.SetPassword = "gi1"
  23. objUser.LoginScript = "lanissysop.bat"
  24. objUser.AccountDisabled = False
  25.  
  26.  
  27.  
  28. objUser.SetInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement