$ou=[ADSI] "LDAP:/..."
$dataSource = import-csv ".."
foreach($dataRecord in $dataSource)
{
$cn = $dataRecord.cn
$sAMAccountName = $dataRecord.sAMAccountName
$givenName = $dataRecord.FirstName
$sn = $dataRecord.LastName
$displayName = $sn + ", " + $givenName
$userPrincipalName = $givenName + "." + $sn + "@nuggetlab.com"
$newUser = $ou.Create("user", "cn=" + $cn)
$newUser.Put("sAMAccountName", $sAMAccountName)
$newUser.Put("userPrincipalName", $userPrincipalName)
$newUser.Put("displayName", $displayName)
$newUser.Put("givenName", $givenName)
$newUser.SetInfo()
$newUser.SetPassword("Password")
$newUser.psbase.InvokeSet("AccountDisabled", $false)
$newUser.Put("company", "The Fantastic Four")
$newUser.SetInfo()
}