$sAMAccountName = $dataRecord.FirstInitial + $dataRecord.LastName $sAMAccountName =…
- User
dataRecord.FirstInitial + sAMAccountName = $sAMAccountName.ToLower()
#Extracts the first and last name from the input data dataRecord.FirstName dataRecord.LastName
- Assistant
To modify the CommonName and DisplayName in the script, you can do the following:
- Update the displayName variables to concatenate the First Name and Last Name accordingly:
powershell$cn = $dataRecord.FirstName + " " + $dataRecord.LastName $displayName = $dataRecord.FirstInitial + ", " + $dataRecord.LastName- Update the New-ADUser command to use the modified variables:
powershell