3

Regarding to this Question link.

How can i change the siteLogo to a new one?

Is it even possible to do it from a ConsoleApplication via CSOM?

Community
  • 1
  • 1
Markus S
  • 248
  • 1
  • 10
  • 3
    Why the hell was this closed? It's perfectly clear what he's asking - he wants to set the SiteLogoUrl property of a Site via Client Side Object Model. You should have moved this to SharePoint Stack Exchange instead of shutting it down as "unclear". – James Love Nov 19 '14 at 12:42

2 Answers2

2

It looks like there are no hooks to the site logo in the client object model like there is in the regular object model. (site.RootWeb.SiteLogoUrl = pictureUrl;)

AdamBT
  • 1,936
  • 2
  • 30
  • 48
0

I couldn't find a way to do it using the CSOM but you can create a new site collection scoped (for SharePoint Online) feature with an event receiver and deploy it as a solution. It worked for me and saved me manually updating 380 sites. I had the FeatureActivated method recursively set the logo on the root web of the site collection and all of the sub webs. Here is the code:

public class Feature1EventReceiver : SPFeatureReceiver
{

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        SPSite site = properties.Feature.Parent as SPSite;
        if (site != null)
        {
            SPWeb web = site.RootWeb;
            SetLogo(web);
        }
    }

    private void SetLogo(SPWeb web) {
        web.SiteLogoUrl = "/SiteAssets/logo.png";
        web.Update();
        foreach (SPWeb subweb in web.Webs)
        {
            SetLogo(subweb);
        }
    }
}