The file (students.csv) is like below -
name,sAMAccountName,GivenName,Surname
John Woods,john.woods,Johnathan,Woods
Kim Akers,kim.akers,Kimberly,Akers
PS C:\> import-csv ./students.csv | new-aduser -Path "OU=Students,OU=User Accounts,DC=contoso,DC=com" -AccountPassword (ConvertTo-SecureString -AsPlainText "********" -Force)
Students created and disabled for the moment.
You forget to add University property, then you need to -
PS C:\> dsquery user "OU=Students,OU=User Accounts,DC=contoso,DC=com" | dsmod user -company "XXX Univerisity"
No comments:
Post a Comment