Create New AD User:
$objOU=[ADSI]"LDAP://OU=Sales,DC=swift,DC=com"
$objUser=$objOU.Create("user","CN= Rui Xu")
$objUser.Put("sAMAccountName","rxu")
$objUser.put("userPrincipalName","rui.xu@abc.com")
$objUser.put("title","Member")
$objUser.put("department","Dev")
$objUser.put("co","China")
$objUser.put("DisplayName","Michael Xu")
$objUser.put("description","Rui Xu")
$objUser.put("givenName","Rui")
$objUser.put("SN","Xu")
$objUser.put("physicalDeliveryOfficeName","DaLian")
$objUser.put("Mail","Michael.Xu@abc.com")
$objUser.SetInfo()
$objUser.SetPassword("demo123!@#")
$objUser.psbase.invokeSet("AccountDisabled",$flase)
$objUser.SetInfo()
阅读(353) | 评论(0) | 转发(0) |