sp-site-designs-studio icon indicating copy to clipboard operation
sp-site-designs-studio copied to clipboard

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

Open CSeb96 opened this issue 4 years ago • 5 comments

After connecting to our tenant using Connect-PnPOnline -useWebLogin as we got MFA enabled and trying to run the command described in the setup portion, it gives me this error.

image

Did anyone else run into this issue? Any workarounds?

Edit: Solved this issue by turning off MFA. Now I am getting The specified user c:0-.f|rolemanager|spo-grid-all-users/{tenantid} not found.

CSeb96 avatar Jul 19 '20 22:07 CSeb96

Usually when I see that error, it indicates I've made a mistake in the XML template file. I strip the XML down to its simplest state and then build it back up piece by piece so I can figure out where I've made my mistake.

sympmarc avatar Jul 19 '20 22:07 sympmarc

Hello @CSeb96,

Unfortunately, it is a known issue for now. Something related has also been encountered here in issue #6 It turns out that the -WebLogin option of PnP PowerShell seems to cause some issues when applying the tenant template. I haven't had the opportunity just yet to figure it out the reason. Just tried with device login, and the same issue occurs...

For now, indeed, the only error-proof solution is to turn off the MFA for the user that executes the script. I will try to come up with a workaround solution ASAP.

Kind regards, Yannick

ypcode avatar Jul 21 '20 14:07 ypcode

Hey @ypcode , so i have turned off MFA for my user and was able to execute the script. It creates the site but doesnt install Design Studio and it gives me this error when done Executing.

image

I dont use the MFA parameter when I am executing the command and the correct tenant Id does get appended to it.

Thanks for your help :)

CSeb96 avatar Jul 29 '20 21:07 CSeb96

Hi @CSeb96 ,

Could you please try , on any of your SharePoint Site, try to add permissions to "Everyone" and see what you gets as the people suggestions ?

Regards, Yannick

ypcode avatar Jul 30 '20 16:07 ypcode

Hey @ypcode I get 'Everyone except external users' group.

Cheers

CSeb96 avatar Aug 03 '20 21:08 CSeb96