Forum Discussion
Lee-Martin
Jan 16, 2023Brass Contributor
Add-PnPTenantTheme - Attempted to perform an unauthorized operation.
I've tried to upload a theme, but I'm geting an Attempted to perform an unauthorized operation I'm an admin on the particular site I'm trying to upload to, so I assumed this would be enough permi...
SvenSieverding
Jan 17, 2023Bronze Contributor
Mhm.... thats wierd..
Get-PNPWeb should give you the name of the site you are connected to, even if you just have "read" permissions.
How did you connect to the site? What was the output of "Connect-PnPOnline"?
Best Regards,
Sven
Get-PNPWeb should give you the name of the site you are connected to, even if you just have "read" permissions.
How did you connect to the site? What was the output of "Connect-PnPOnline"?
Best Regards,
Sven
Lee-Martin
Jan 17, 2023Brass Contributor
I'm using Connect-PnPOnline -Url https://<homesite>.sharepoint.com/<site> -Interactive
The response when I try and add a theme using your method above gives me
Cannot contact site at the specified URL https://<homesite>.sharepoint.com/<site>. There is
no Web named "/gskgepo/_vti_bin/sites.asmx".
What is this "/_vti_bin/sites.asmx" stuff that gets added to the end?
The response when I try and add a theme using your method above gives me
Cannot contact site at the specified URL https://<homesite>.sharepoint.com/<site>. There is
no Web named "/gskgepo/_vti_bin/sites.asmx".
What is this "/_vti_bin/sites.asmx" stuff that gets added to the end?
- Lee-MartinJan 17, 2023Brass ContributorFigured it out, I needed to add sites before /<site>
https://<homesite>.sharepoint.com/sites/<site>- Lee-MartinJan 17, 2023Brass Contributor
SvenSieverding
However, the theme is not appearing in SharePoint (it doesn't appear in change the look)- SvenSieverdingJan 17, 2023Bronze Contributor
Hello Lee-Martin ,
if you apply the theme via the "Invoke-PnPSiteTemplate" command, it is applied immediately as the current selection below site theme for the current site and does not show up below the "Sharepoint Theme themes". But you don't need to be a SharePoint Admin to do so.
If you want your theme to be displayed below "SharePoint themes", you need to connect to your SharePoint admin site ("https://<tenant>-admin.sharepoint.com") as a SharePoint administrator and invoke the Add-PnPTenantTheme command. But you need to be a SharePoint admin for that and that theme will be available on all sites.$themepalette = @{ "themePrimary" = "#00ffff"; "themeLighterAlt" = "#f3fcfc"; "themeLighter" = "#daffff"; "themeLight" = "#affefe"; "themeTertiary" = "#76ffff"; "themeSecondary" = "#39ffff"; "themeDarkAlt" = "#00c4c4"; "themeDark" = "#009090"; "themeDarker" = "#005252"; "neutralLighterAlt" = "#f8f8f8"; "neutralLighter" = "#f4f4f4"; "neutralLight" = "#eaeaea"; "neutralQuaternaryAlt" = "#dadada"; "neutralQuaternary" = "#d0d0d0"; "neutralTertiaryAlt" = "#c8c8c8"; "neutralTertiary" = "#a6a6a6"; "neutralSecondaryAlt" = "#767676"; "neutralSecondary" = "#666666"; "neutralPrimary" = "#333"; "neutralPrimaryAlt" = "#3c3c3c"; "neutralDark" = "#212121"; "black" = "#000000"; "white" = "#fff"; "primaryBackground" = "#fff"; "primaryText" = "#333" } Add-PnPTenantTheme -Identity "MyCompanyTheme" -Palette $themepalette -IsInverted $false
Best Regards,
Sven