#Uses a foreach loop to create multiple users from the input CSV file foreach…
- User
#Uses a foreach loop to create multiple users from the input CSV file foreach (dataSource) { #Constructs the common name (CN) for the user account dataRecord.FirstInitial + " " + dataRecord.LastName #creates the sAMAccountName for the user account sAMAccountName = dataRecord.LastName sAMAccountName.ToLower()
- Assistant
To modify the CommonName to be FirstName LastName and DisplayName to be FirstInitial, LastName, you can make the following adjustments in your foreach loop:
powershell