Forum Discussion
MS-Teams Command "New-Team" Site URL incorrect
- Oct 30, 2023
According to the documentation for the Alias (aka mailNickname), there's no problem with using a hyphen. And that's backed up by your manual testing.
It will be some other character that's causing the error, not the hyphen.
What value are you trying to specify for -MailNickname?
Cheers,
Lain
I don't work with SharePoint, but according to the documentation, the modern team site URI is based on the mailNickname value, which you are not including in your example.
So, perhaps try adding the "-MailNickname mysitename" parameter into your existing New-Team commandlet and see if that results in a more meaningful URI.
Note: We cannot see what value is stored in your $teamName variable, but be aware that certain characters cannot be used in mailNickname (notably spaces, which are most common in display names):
You will want to ensure that you remove all ineligible characters from your $teamName variable. (i.e. store a parsed value in another variable, or remove them on the fly - there's multiple ways for achieving this required outcome.)
Cheers,
Lain
- SkypeForBusinessOct 30, 2023Copper ContributorHi Lain,
It is working with the mailNickname value but I need to have the "-" in it. When I create the Group manually it is possible to have the "-" in the URL. Is there a solution for this? now it says:
New-Team : Error occurred while executing
Code: Request_BadRequest
Message: Invalid value specified for property 'mailNickname' of resource 'Group'.- LainRobertsonOct 30, 2023Silver Contributor
According to the documentation for the Alias (aka mailNickname), there's no problem with using a hyphen. And that's backed up by your manual testing.
It will be some other character that's causing the error, not the hyphen.
What value are you trying to specify for -MailNickname?
Cheers,
Lain
- SkypeForBusinessOct 30, 2023Copper ContributorOh I found it. I was using the same inputvariable for the alias, which had spaces in it. I know will trim the spaces and save the value in a new variable which is then used for the -MailNickname.
Many thanks for your help