Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*******************
- '* Script BY Alex
- '* Question 1
- '*******************
- ON Error Resume NEXT
- '* Part 1: create an OU named HR
- strDomain = "dc=contoso,dc=com"
- set objDomain = GetObject("LDAP://" & strDomain)
- set objOU = objDomain.Create("OrganizationalUnit", "ou=HR")
- objOU.setInfo
- '* Part 2: CREATE USER Obama, IN the HR OU
- strContainer = "ou=HR,dc=contoso,dc=com"
- SET objContainer = GetObject("LDAP://" & strContainer)
- SET objUser = objContainer.CREATE("user", "cn=Obama")
- objUser.sAMAccountName = "Obama"
- objUser.SetPasword "password"
- objUser.AccountDisabled = FALSE
- objUser.setInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement