Link to home
Start Free TrialLog in
Avatar of IT Guy
IT GuyFlag for United States of America

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,DC=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.
Avatar of Jeremy Weisinger
Jeremy Weisinger

SAM is the SAMAccountName. This is generally referred to as the username.
Avatar of IT Guy

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.
Casing is sAMAccountName
Avatar of IT Guy

ASKER

Shaun Vermaak,

What do you mean? What do I need to change?
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT Guy

ASKER

I have made that change but still continue to receive the exact same error message.
Avatar of IT Guy

ASKER

Shaun Vermaak,

Thank you for your comment.

I am now aware and am more careful about using the correct case within PowerShell.