Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.60 KB | None | 0 0
  1. '*******************
  2. '* Script BY Alex
  3. '* Question 1
  4. '*******************
  5.  
  6. ON Error Resume NEXT
  7.  
  8. '* Part 1: create an OU named HR
  9.  
  10. strDomain = "dc=contoso,dc=com"
  11. set objDomain = GetObject("LDAP://" & strDomain)
  12. set objOU = objDomain.Create("OrganizationalUnit", "ou=HR")
  13. objOU.setInfo
  14.  
  15. '* Part 2: CREATE USER Obama, IN the HR OU
  16.  
  17. strContainer = "ou=HR,dc=contoso,dc=com"
  18. SET objContainer = GetObject("LDAP://" & strContainer)
  19. SET objUser = objContainer.CREATE("user", "cn=Obama")
  20. objUser.sAMAccountName = "Obama"
  21. objUser.SetPasword "password"
  22. objUser.AccountDisabled = FALSE
  23. objUser.setInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement