Apply-pnp template error: Value does not fall within the expected range

%3CLINGO-SUB%20id%3D%22lingo-sub-722106%22%20slang%3D%22en-US%22%3EApply-pnp%20template%20error%3A%20Value%20does%20not%20fall%20within%20the%20expected%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-722106%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20PNP%20to%20create%20sites%20and%20apply%20templates.%3CBR%20%2F%3EI%20noticed%20this%3A%26nbsp%3B%3C%2FP%3E%3CP%3E-Sites%20where%20the%20standard%20groups%20are%20named%20%E2%80%9CSite%20Members%E2%80%9D%2C%20%E2%80%9CSite%20Owners%E2%80%9D%2C%20%E2%80%9CSite%20Visitors%E2%80%9D%20throw%20an%20error%3C%2FP%3E%3CP%3E-Sites%20where%20the%20standard%20groups%20are%20named%20%26nbsp%3Bfollowing%20the%20site%20name%20e.g.%20%E2%80%9CGilbert%20Okello%20Members%E2%80%9D%2C%20%E2%80%9CGilbert%20Okello%20Owners%E2%80%9D%20etc%20%E2%80%A6%20don%E2%80%99t%20throw%20an%20error.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20error%20thrown%20is%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EApply-PnPProvisioningTemplate%20%3A%20Value%20does%20not%20fall%20within%20the%20expected%20range.%20At%20line%3A36%20char%3A1%20%2B%20Apply-PnPProvisioningTemplate%20-Path%20('%3CA%20href%3D%22https%3A%2F%2FNNNN.sharepoint.com%2Fs%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FNNNN.sharepoint.com%2Fs%3C%2FA%3E%20...%20%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%20%2B%20CategoryInfo%20%3A%20WriteError%3A%20(%3A)%20%5BApply-PnPProvisioningTemplate%5D%2C%20ServerException%20%2B%20FullyQualifiedErrorId%20%3A%20EXCEPTION%2CSharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate%20%26nbsp%3B%3C%2FSPAN%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E-------------------%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20pointers%20to%20where%20the%20issue%20could%20be%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1137525%22%20slang%3D%22en-US%22%3ERe%3A%20Apply-pnp%20template%20error%3A%20Value%20does%20not%20fall%20within%20the%20expected%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1137525%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4027%22%20target%3D%22_blank%22%3E%40Gilbert%20Okello%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20same%20issue%20too.%20Not%20sure%20why%20it%20is%20throwing%20that%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

I am using PNP to create sites and apply templates.
I noticed this: 

-Sites where the standard groups are named “Site Members”, “Site Owners”, “Site Visitors” throw an error

-Sites where the standard groups are named  following the site name e.g. “Gilbert Okello Members”, “Gilbert Okello Owners” etc … don’t throw an error.

The error thrown is:

Apply-PnPProvisioningTemplate : Value does not fall within the expected range. At line:36 char:1 + Apply-PnPProvisioningTemplate -Path ('https://NNNN.sharepoint.com/s ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate   

-------------------

Any pointers to where the issue could be?

1 Reply
Highlighted

@Gilbert Okello 

 

I have same issue too. Not sure why it is throwing that error.