I tried to create a modern team site using PnpCore. I tried to do it according the Create Modern Sites in SharePoint Online using CSOM , using the newer SharepointPnPCore Online 2.24.1803

TeamSiteCollectionCreationInformation modernteamSiteInfo = new TeamSiteCollectionCreationInformation
    Description = "Test modern teamsite description",
    DisplayName = "Test Modern Team Site",
    Alias = "https://tenantname.sharepoint.com/sites/TestModernTeamSite",
    IsPublic = true,

var createModernSite = await context.CreateSiteAsync(modernteamSiteInfo);

I end up with following error message:

{"error":{"code":"-1, System.Data.Services.Client.DataServiceClientException","message":{"lang":"en-US","value":"{\"odata.error\":{\"code\":\"Request_BadRequest\",\"message\":{\"lang\":\"en\",\"value\":\"Invalid value specified for property 'mailNickname' of resource 'Group'.\"},\"requestId\":\"256331ca-f5a9-4664-b48f-355747cb25d5\",\"date\":\"2018-03-12T09:29:40\",\"values\":[{\"item\":\"PropertyName\",\"value\":\"mailNickname\"},{\"item\":\"PropertyErrorCode\",\"value\":\"InvalidValue\"}]}}"}}}

Did I miss anything?

  • 1
    how about changing to Alias = "TestModernTeamSite", and checking ? Mar 12, 2018 at 9:56
  • @GautamSheth Changing Alias to use juist the Title instead of SiteUrl worked
    – Ashutosh
    Oct 25, 2018 at 4:57

1 Answer 1


Creating a modern team site also creates unified group in Office365 that is associated with the newly created team site.

The PnP package takes care of this but under the hood it seems that alias name is used as mailNickName property for the underlying Office365 group and it cannot contain special characters like slash(/), colon(:) etc.

Try giving alias name without special characters and spaces (or allowed special characters) and it should work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.