Error:Microsoft.SharePoint.Client.ServerException: Argument SiteUrl must be a tenant administration

%3CLINGO-SUB%20id%3D%22lingo-sub-50372%22%20slang%3D%22en-US%22%3EError%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50372%22%20slang%3D%22en-US%22%3E%3CP%3EHello-%20I%20ma%20using%20PNP%20site%20provisioning%20engine%20to%20create%20sites.%20But%20while%20running%20the%20batch%20and%20at%20the%20time%20of%20creation%20of%20site%20it%20is%20giving%20error%3A%3C%2FP%3E%3CP%3E%22Microsoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administration%20site.%22%3C%2FP%3E%3CP%3EWhile%20I%20have%20used%20Poershell%20to%20make%20the%20site%20collection%20as%20tenant%20administration%20site.%20Also%20the%20apps%20are%20having%20Full%20Control%20permission%20in%20the%20site.%3C%2FP%3E%3CP%3EAny%20help%20will%20be%20much%20appreaciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50459%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50459%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3A%20Since%20I%20am%20using%20on%20Premises%3A%20Below%202%20PS%20commands%20I%20have%20used.%3C%2FP%3E%3CP%3E%3CU%3EScript1%3A%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%23%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%23%20Enable%20the%20remote%20site%20collection%20creation%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Efor%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eon%3C%2FFONT%3E%3C%2FSPAN%3E-prem%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Ein%3C%2FFONT%3E%3C%2FSPAN%3E%20web%20application%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Elevel%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%23%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EIf%3C%2FFONT%3E%3C%2FSPAN%3E%20this%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eis%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Enot%3C%2FFONT%3E%3C%2FSPAN%3E%20done%2C%20unknon%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eobject%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eexception%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eis%3C%2FFONT%3E%3C%2FSPAN%3E%20raised%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eby%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20CSOM%20code%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%23%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24WebApplicationUrl%20%3D%20http%3A%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3E%2F%2Fdev.contoso.com%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24snapin%20%3D%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EGet%3C%2FFONT%3E%3C%2FSPAN%3E-PSSnapin%20%7C%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWhere%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EObject%3C%2FFONT%3E%3C%2FSPAN%3E%20%7B%24_.Name%20-eq%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3E'Microsoft.SharePoint.Powershell'%3C%2FFONT%3E%3C%2FSPAN%3E%7D%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eif%3C%2FFONT%3E%3C%2FSPAN%3E%20(%24snapin%20-eq%20%24%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Enull%3C%2FFONT%3E%3C%2FSPAN%3E)%20%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%7B%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWrite%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EHost%3C%2FFONT%3E%3C%2FSPAN%3E%20%22Loading%20SharePoint%20Powershell%20Snapin%22%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EAdd%3C%2FFONT%3E%3C%2FSPAN%3E-PSSnapin%20%22Microsoft.SharePoint.Powershell%22%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%7D%20%20%20%20%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%26nbsp%3B%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24webapp%3D%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EGet%3C%2FFONT%3E%3C%2FSPAN%3E-SPWebApplication%20%24WebApplicationUrl%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24newProxyLibrary%20%3D%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3ENew%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EObject%3C%2FFONT%3E%3C%2FSPAN%3E%20%22Microsoft.SharePoint.Administration.SPClientCallableProxyLibrary%22%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24newProxyLibrary.AssemblyName%20%3D%20%22Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub%2C%20Version%3D15.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D71e9bce111e9429c%22%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24newProxyLibrary.SupportAppAuthentication%20%3D%20%24%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Etrue%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24webapp.ClientCallableSettings.ProxyLibraries.%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EAdd%3C%2FFONT%3E%3C%2FSPAN%3E(%24newProxyLibrary)%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%24webapp.%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EUpdate%3C%2FFONT%3E%3C%2FSPAN%3E()%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWrite%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EHost%3C%2FFONT%3E%3C%2FSPAN%3E%20%22Successfully%20added%20TenantAdmin%20ServerStub%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eto%3C%2FFONT%3E%3C%2FSPAN%3E%20ClientCallableProxyLibrary.%22%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%23%20Reset%20the%20memory%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eof%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20web%20application%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWrite%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EHost%3C%2FFONT%3E%3C%2FSPAN%3E%20%22IISReset...%22%20%20%20%20%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3ERestart-Service%20W3SVC%2CWAS%20-force%3C%2FPRE%3E%3CP%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWrite%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EHost%3C%2FFONT%3E%3C%2FSPAN%3E%20%22IISReset%20complete%20on%20this%20server%2C%20remember%20other%20servers%20in%20farm%20as%20well.%22%20%20%20%20%3C%2FPRE%3E%3CP%3E%3CU%3E%26nbsp%3BScript2%3A%3C%2FU%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%23%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%23%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3ESet%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eadmin%3C%2FFONT%3E%3C%2FSPAN%3E%20site%20type%20property%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eto%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20site%20collection%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eusing%3C%2FFONT%3E%3C%2FSPAN%3E%20PS%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Efor%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eany%3C%2FFONT%3E%3C%2FSPAN%3E%20site%20collection%20type.%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%23%20This%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eis%3C%2FFONT%3E%3C%2FSPAN%3E%20needed%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eto%3C%2FFONT%3E%3C%2FSPAN%3E%20be%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eset%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Efor%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20site%20collection%20which%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eis%3C%2FFONT%3E%3C%2FSPAN%3E%20used%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eas%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%23%20%22%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EConnection%3C%2FFONT%3E%3C%2FSPAN%3E%20point%22%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Efor%3C%2FFONT%3E%3C%2FSPAN%3E%20the%20CSOM%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Ewhen%3C%2FFONT%3E%3C%2FSPAN%3E%20site%20collections%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eare%3C%2FFONT%3E%3C%2FSPAN%3E%20created%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Ein%3C%2FFONT%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eon%3C%2FFONT%3E%3C%2FSPAN%3E-prem%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%23%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%24siteColUrl%20%3D%20http%3A%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3E%2F%2Fdev.contoso.com%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%26nbsp%3B%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%24snapin%20%3D%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EGet%3C%2FFONT%3E%3C%2FSPAN%3E-PSSnapin%20%7C%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWhere%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EObject%3C%2FFONT%3E%3C%2FSPAN%3E%20%7B%24_.Name%20-eq%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3E'Microsoft.SharePoint.Powershell'%3C%2FFONT%3E%3C%2FSPAN%3E%7D%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eif%3C%2FFONT%3E%3C%2FSPAN%3E%20(%24snapin%20-eq%20%24%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Enull%3C%2FFONT%3E%3C%2FSPAN%3E)%20%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%7B%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EWrite%3C%2FFONT%3E%3C%2FSPAN%3E-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EHost%3C%2FFONT%3E%3C%2FSPAN%3E%20%22Loading%20SharePoint%20Powershell%20Snapin%22%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EAdd%3C%2FFONT%3E%3C%2FSPAN%3E-PSSnapin%20%22Microsoft.SharePoint.Powershell%22%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%7D%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%26nbsp%3B%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%24site%20%3D%20%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3Eget%3C%2FFONT%3E%3C%2FSPAN%3E-spsite%20-%3CSPAN%3E%3CFONT%20face%3D%22Courier%20New%22%3EIdentity%3C%2FFONT%3E%3C%2FSPAN%3E%20%24siteColUrl%3C%2FPRE%3E%3CP%3E%3CU%3E%3C!--%20%20CRLF%20%20--%3E%3C%2FU%3E%3C%2FP%3E%3CPRE%3E%24site.AdministrationSiteType%20%3D%20%5BMicrosoft.SharePoint.SPAdministrationSiteType%5D%3A%3ATenantAdministration%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStill%20getting%20error%20after%20running%20the%20batch%20file..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%5BError%5D%20Error%20during%20stage%20%22SiteCreation%22%20siteprovisioning%3A%20%22https%3A%2F%2FSSSS%22%3CBR%20%2F%3EMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administration%20site.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50450%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50450%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42205%22%20target%3D%22_blank%22%3E%40Sayan%20DuttaMajumdar%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20script%20isn't%20using%20the%20PnP%20PowerrShell%20options%20available.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20look%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fblob%2Fmaster%2FDocumentation%2Freadme.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fblob%2Fmaster%2FDocumentation%2Freadme.md%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20looking%20for%20the%20%26nbsp%3BNew-PnPTenantSite%20Cmdlet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fblob%2Fmaster%2FDocumentation%2FNewPnPTenantSite.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fblob%2Fmaster%2FDocumentation%2FNewPnPTenantSite.md%3C%2FA%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CDIV%20class%3D%22container%20new-discussion-timeline%20experiment-repo-nav%22%3E%3CDIV%20class%3D%22repository-content%22%3E%3CDIV%20class%3D%22file%22%3E%3CDIV%20class%3D%22readme%20blob%20instapaper_body%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50446%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50446%22%20slang%3D%22en-US%22%3E%3CP%3EHi-%20I%20have%20run%20below%202%20Powershell%20command%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CSTRONG%3EScript1%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%3CP%3Ecls%3CBR%20%2F%3Eif%20((Get-PSSnapin%20%22Microsoft.SharePoint.PowerShell%22%20-ErrorAction%20SilentlyContinue)%20-eq%20%24null)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Add-PSSnapin%20%22Microsoft.SharePoint.PowerShell%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%24url%20%3D%22https%3A%2F%2FSSSSSSSSSSSSSSSSSSSSSS%22%3C%2FP%3E%3CP%3EWrite-Host%20%22Setting%20%24url%20as%20tenant%20site%20...%22%20-ForegroundColor%20Yellow%3C%2FP%3E%3CP%3E%24site%20%3D%20get-spsite%20-Identity%20%24url%3CBR%20%2F%3E%24site.AdministrationSiteType%20%3D%20%5BMicrosoft.SharePoint.SPAdministrationSiteType%5D%3A%3ATenantAdministration%26nbsp%3B%3CBR%20%2F%3EWrite-Host%20%22%24url%20set%20as%20tenant%20site!%22%20-ForegroundColor%20Green%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3EScript2%3A%3C%2FU%3E%3C%2FP%3E%3CP%3ESet-SPSiteAdministration%20%22https%3A%2Fsssssss%22%20-AdministrationSiteType%20TenantAdministration%3C%2FP%3E%3CP%3EIISRESET%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50444%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50444%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20creating%20a%20batch%20file%20for%20on%20Premises%20SP%202013.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50409%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50409%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42205%22%20target%3D%22_blank%22%3E%40Sayan%20DuttaMajumdar%3C%2FA%3E%26nbsp%3Bcan%20you%20post%20your%20powershell%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-50377%22%20slang%3D%22en-US%22%3ERe%3A%20Error%3AMicrosoft.SharePoint.Client.ServerException%3A%20Argument%20SiteUrl%20must%20be%20a%20tenant%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-50377%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20connect%20%2F%20authenticate%20to%20the%20SharePoint%20Admin%20Center%20site%20(https%3A%2F%2F%5Btenantname%5D-admin.sharepoint.com%20before%20executing%20your%20PowerShell%20script%3F%20Typically%2C%20before%20executing%20your%20PowerShell%20script%20to%20create%20sites%20(site%20collections)%2C%20you'd%20first%20have%20to%20connect%20to%20SharePoint%20Online%20using%20one%20of%20the%20Connect-SPOService%20%2F%20Connect-SPOnline%20%2F%20Connect-PnPOnline%20PowerShell%20commands%20and%20specify%20your%20SharePoint%20Admin%20Center%20site%20with%20a%20least%20SharePoint%20Administrator%20credentials%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello- I ma using PNP site provisioning engine to create sites. But while running the batch and at the time of creation of site it is giving error:

"Microsoft.SharePoint.Client.ServerException: Argument SiteUrl must be a tenant administration site."

While I have used Poershell to make the site collection as tenant administration site. Also the apps are having Full Control permission in the site.

Any help will be much appreaciated.

6 Replies

Did you connect / authenticate to the SharePoint Admin Center site (https://[tenantname]-admin.sharepoint.com before executing your PowerShell script? Typically, before executing your PowerShell script to create sites (site collections), you'd first have to connect to SharePoint Online using one of the Connect-SPOService / Connect-SPOnline / Connect-PnPOnline PowerShell commands and specify your SharePoint Admin Center site with a least SharePoint Administrator credentials

I am creating a batch file for on Premises SP 2013.

Hi- I have run below 2 Powershell command:

 

Script1:

cls
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$url ="https://SSSSSSSSSSSSSSSSSSSSSS"

Write-Host "Setting $url as tenant site ..." -ForegroundColor Yellow

$site = get-spsite -Identity $url
$site.AdministrationSiteType = [Microsoft.SharePoint.SPAdministrationSiteType]::TenantAdministration 
Write-Host "$url set as tenant site!" -ForegroundColor Green

 

Script2:

Set-SPSiteAdministration "https:/sssssss" -AdministrationSiteType TenantAdministration

IISRESET

Hi @Sayan DuttaMajumdar,

 

This script isn't using the PnP PowerrShell options available.

 

Please look here: https://github.com/SharePoint/PnP-PowerShell/blob/master/Documentation/readme.md

 

 

You are looking for the  New-PnPTenantSite Cmdlet.

 

https://github.com/SharePoint/PnP-PowerShell/blob/master/Documentation/NewPnPTenantSite.md

 

 

 

Hi: Since I am using on Premises: Below 2 PS commands I have used.

Script1:

#

# Enable the remote site collection creation for on-prem in web application level

# If this is not done, unknon object exception is raised by the CSOM code

#

$WebApplicationUrl = http://dev.contoso.com

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}

if ($snapin -eq $null) 

{

    Write-Host "Loading SharePoint Powershell Snapin"

    Add-PSSnapin "Microsoft.SharePoint.Powershell"

}    

 

$webapp=Get-SPWebApplication $WebApplicationUrl

$newProxyLibrary = New-Object "Microsoft.SharePoint.Administration.SPClientCallableProxyLibrary"

$newProxyLibrary.AssemblyName = "Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"

$newProxyLibrary.SupportAppAuthentication = $true

$webapp.ClientCallableSettings.ProxyLibraries.Add($newProxyLibrary)

$webapp.Update()

Write-Host "Successfully added TenantAdmin ServerStub to ClientCallableProxyLibrary."

# Reset the memory of the web application

Write-Host "IISReset..."    

Restart-Service W3SVC,WAS -force

Write-Host "IISReset complete on this server, remember other servers in farm as well."    

 Script2:

 

#

# Set admin site type property to the site collection using PS for any site collection type.

# This is needed to be set for the site collection which is used as the 

# "Connection point" for the CSOM when site collections are created in on-prem

#

$siteColUrl = http://dev.contoso.com

 

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}

if ($snapin -eq $null) 

{

    Write-Host "Loading SharePoint Powershell Snapin"

    Add-PSSnapin "Microsoft.SharePoint.Powershell"

}

 

$site = get-spsite -Identity $siteColUrl

$site.AdministrationSiteType = [Microsoft.SharePoint.SPAdministrationSiteType]::TenantAdministration

 

Still getting error after running the batch file..

 

[Error] Error during stage "SiteCreation" siteprovisioning: "https://SSSS"
Microsoft.SharePoint.Client.ServerException: Argument SiteUrl must be a tenant administration site.