Change logo for Team sites in SharePoint online

LUAN 1 Reputation point
2020-10-30T14:12:35.933+00:00

Hi everyone,

I want to make Site Design for SharePoint online and change a site logo in modern UI using Site Design create the site script in Json the following the link:

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema

But unlucky the doc from microsoft only support for change logo in communication site using Site design not support for Team Site as following :

36353-capture1.jpg

And I also write console app to change site logo as following :

using Microsoft.SharePoint.Client;

using (ClientContext clientContext = new ClientContext("https://Mydev.sharepoint.com/sites/MySiteCollection"))
{
Web oWeb = clientContext.Web;
// Upload logo image to any libary and give relative URL over here
oWeb.SiteLogoUrl = "https://Mydev.sharepoint.com/sites/MySiteCollection/SiteAssets/siteIcon.png";
oWeb.Update();
clientContext.ExecuteQuery();
}
I also upload image to SiteAssets with name : siteIcon.png with override file existing. The code run with no error. But it seem not change new logo.

I don't want to change site logo manually by UI. I want to change by code Site design or use Rest API.

Please help me if you know how to change the logo for the team site using Site design/call Rest API.

Thank you,

John

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerryzy 10,586 Reputation points
    2020-11-02T07:14:39.39+00:00

    Hi @LUAN ,

    For Modern Team Site, Rest API is not supported to change site logo( Rest only supported classic site currently).

    A workaround is to use PnP PowerShell below to set logo image for Modern Team Site:

    Connect-PnPOnline –Url https://tenant.sharepoint.com/sites/JerryModernTeam –Credentials (Get-Credential)
    Set-PnPSite -LogoFilePath "E:\sp.png"

    SharePoint Online: How to Change Site Logo using PowerShell

    Reference:

    sharepoint-online-how-to-change-logo-using-powershell.html


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Ganesh Sanap 211 Reputation points
    2022-10-15T06:49:06.65+00:00

    @LUAN You can use SharePoint REST API or Power automate flow to update SharePoint online modern site logo (teams as well as communication site).

    Check this detailed article for more information: [Update SharePoint Site Logo using Power Automate][1]

      [1]: https://ganeshsanapblogs.wordpress.com/2022/10/15/update-sharepoint-site-logo-using-power-automate/    
    

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have extra questions about this answer, please click "Comment". For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.