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? Aug 25, 2020 at 8:41
  • Im getting two errors: [Site Security] [16] [Information] Failed to EnsureUser c:0o.c|federateddirectoryclaimprovider
    – hittle08
    Aug 26, 2020 at 15:18
  • [OfficeDevPnP.Core] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: The specified user
    – hittle08
    Aug 26, 2020 at 15:19

1 Answer 1


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.

  • 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, 2020 at 12:46

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.