- Newest
- Most votes
- Most comments
The error indicates that the SamAccountName provided in the New-ADUser command is not formatted correctly. The SamAccountName needs to be a valid account name that can be used to log into the domain. It typically looks like firstname.lastname or firstinitial.lastname.
Please try the following:
-
Use a valid account name format like 'batman.gotham' instead of the email address for SamAccountName and UserPrincipalName
-
Make sure the SamAccountName is unique in the domain
-
Remove any special characters or spaces from the SamAccountName
-
Verify the domain name specified with -Path is correct
-
Check if you have permissions to create users in the OU specified with -Path
Try the below command:
New-ADUser -Name 'Batman Gotham' -SamAccountName 'batman.gotham' -UserPrincipalName 'batman.gotham@darknight.com' -Path 'CN=Users,OU=Operations,DC=darknight,DC=com'
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago