IT Guy
asked on
Explanation for SAM entry
Within the https://social.technet.microsoft.com/wiki/contents/articles/24541.powershell-bulk-create-ad-users-from-csv-file.aspx#Code_Used webpage which contains instructions on creating a CSV spreadsheet that contains fields such as the user's firstname, lastname, maildomain, etc. what should be entered within the SAM spreadsheet column?
I understand what all of fields need except for the SAM field. What should be entered within the SAM field?
Firstname | Lastname | Maildomain | SAM | OU | Password | Description
User | Test01 | contoso.com | utest01 | OU=Standard Users,OU=Users,DC=domain,D C=loc | P@ssw0rd| Test User
One of the lines of code explains the syntax as " New-ADUser -Name "$Displayname" -DisplayName "$Displayname" -SamAccountName $SAM -UserPrincipalName $UPN -GivenName "$UserFirstname" -Surname "$UserLastname" -Description "$Description" -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path "$OU" -ChangePasswordAtLogon $false –PasswordNeverExpires $true -server domain"
Please provide me with the correct entry that should be used for SAM.
I understand what all of fields need except for the SAM field. What should be entered within the SAM field?
Firstname | Lastname | Maildomain | SAM | OU | Password | Description
User | Test01 | contoso.com | utest01 | OU=Standard Users,OU=Users,DC=domain,D
One of the lines of code explains the syntax as " New-ADUser -Name "$Displayname" -DisplayName "$Displayname" -SamAccountName $SAM -UserPrincipalName $UPN -GivenName "$UserFirstname" -Surname "$UserLastname" -Description "$Description" -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path "$OU" -ChangePasswordAtLogon $false –PasswordNeverExpires $true -server domain"
Please provide me with the correct entry that should be used for SAM.
SAM is the SAMAccountName. This is generally referred to as the username.
ASKER
I keep receiving an error message when I try to import the user information from the .CSV file.
Please see my other question "Correct syntax for CSV spreadsheet to create Server 2016 AD accounts" posted here: https://www.experts-exchange.com/questions/29050416/Correct-syntax-for-CSV-spreadsheet-to-create-Server-2016-AD-accounts.html and let me know what needs to be corrected so I will be able to create these usernames using the CSV spreadsheet running within Windows Power Shell.
Please see my other question "Correct syntax for CSV spreadsheet to create Server 2016 AD accounts" posted here: https://www.experts-exchange.com/questions/29050416/Correct-syntax-for-CSV-spreadsheet-to-create-Server-2016-AD-accounts.html and let me know what needs to be corrected so I will be able to create these usernames using the CSV spreadsheet running within Windows Power Shell.
Casing is sAMAccountName
ASKER
Shaun Vermaak,
What do you mean? What do I need to change?
What do you mean? What do I need to change?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have made that change but still continue to receive the exact same error message.
ASKER
Shaun Vermaak,
Thank you for your comment.
I am now aware and am more careful about using the correct case within PowerShell.
Thank you for your comment.
I am now aware and am more careful about using the correct case within PowerShell.