0

So I try to create a new team site in an organization with Chinese region. And my(code c# or powershell) gives me the same error

New-PnPSite : {"d":{"CreateGroupEx":{"__metadata":{"type":"Microsoft.SharePoint.Portal.GroupSiteInfo"},"DocumentsUrl":n
ull,"ErrorMessage":null,"GroupId":"267a6743-a4c4-4f41-981d-9783c56d4852","SiteStatus":1,"SiteUrl":null}}}
At line:1 char:16
+ ... amSiteUrl = New-PnPSite -Type TeamSite -Title "displayName" -Alias "q ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [New-PnPSite], Exception
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.NewSite

But it's interesting that I'm able to create a team site inside another organization which has default region with the same code.

ps code:

Connect-PnPOnline "https://mytenant.sharepoint.cn/"

$teamSiteUrl = New-PnPSite -Type TeamSite -Title "displayName" -Alias "mymodernteamsite" -Description "description" -IsPublic -Classification "classification" 

c# code: var targetTenantUrl = "https://mytenant.sharepoint.cn/";

using (var context = new ClientContext(targetTenantUrl))
{
    context.Credentials = appropiateCredentials;


    var teamContext = await context.CreateSiteAsync(
        new TeamSiteCollectionCreationInformation
        {
            Alias = "mymodernteamsite",
            DisplayName = "displayName",
            Description = "description",
            Classification = "classification",
            IsPublic = true
        });
    teamContext.Load(teamContext.Web, w => w.Url);
    teamContext.ExecuteQueryRetry();
    Console.WriteLine(teamContext.Web.Url);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.