While creating an Microsoft 365 user, I get the following error "Invalid syntax Parameter Name."

Last updated on:

Error Message

While creating an Microsoft 365 user, I get the following error "Invalid syntax Parameter Name."

Possible Cause

This behavior occurs because certain special characters aren't permitted in user names that you create in the Microsoft 365. These special characters include but aren't limited to the following:

Property UserPrincipalName requirements
Characters allowed
  • A - Z
  • a - z
  • 0 - 9
  • ' . - _ ! # ^ ~
Characters not allowed
  • Any "@" character that's not separating the username from the domain.
  • Can't contain a period character "." immediately preceding the "@" symbol
  • Can't contain an ampersand (&) character in the user name.
Length constraints
  • The total length must not exceed 113 characters
  • There can be up to 64 characters before the "@" symbol
  • There can be up to 48 characters after the "@" symbol

Solution

This message is displayed when there is an error in the value being assigned to the parameter. There might be spaces or special characters in the values. Ensure that the parameter is not empty and does not contain any spaces or special characters.