Ok I am trying to apply a Provisioning template to a site and I keep getting the error

"Apply-PnPProvisioningTemplate : Object reference not set to an instance of an object."

Ive been following this tutorial on microsoft.

Once I get to the Apply-PnPProvisioningTemplate -Path i get the error above. Any ideas?

Note: Running the latest version of SharePointPnPPowerShellOnlien 3.24.2008.1

  • Can you check the trace log after what step is ti failing? – Akshay Randive Aug 25 at 8:41
  • Im getting two errors: [Site Security] [16] [Information] Failed to EnsureUser c:0o.c|federateddirectoryclaimprovider – hittle08 Aug 26 at 15:18
  • [OfficeDevPnP.Core] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: The specified user – hittle08 Aug 26 at 15:19

The template is trying to find federateddirectoryclaimprovider user for applying permissions to it, but is not able to find this user in Site. To avoid this you can execute the Apply-PnPProvisioningTemplate command with -ExcludeHandlers SiteSecurity switch by doing so it will not apply permissions to users aganist any SharePoint groups being created.

| improve this answer | |
  • Still getting the two errors above, I noticed in the server error details that I have the error Error during webhook add/update: AADSTS65001: The user or administrator has not consented to use the application with ID – hittle08 Aug 27 at 12:46

Your Answer

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

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