1

I want to change the company logo on suite bar in SharePoint 2013, but the system administrator has turned off the Master Page editing function in SharePoint designer, I was asked to make an CSS Style Sheet, Upload it to the SiteAssets library and added to the web with PowerShell. But I am really new to this field, is there any tutorial material I can look for this?

1

If you go to the top level site -> site settings -> Master Page-> Alternate CSS URL

Here you can point to a css file that is load after the SharePoint css files, so you can overwrite the SharePoint css if you need to, without changing the masterpage.

You can store your custom css in e.g. the site asses library and customize it with SharePoint designer (or any other editing tool).

If you want to do this with PowerShell you need to look at using the CSOM api's.

This is the code I'm using to change the css and the logo.

using (var context = TokenHelper.GetClientContextWithAccessToken(uri.ToString(), token))
                {
                    var web = context.Web;
                    context.Load(web);
                    context.ExecuteQuery();
                    web.AlternateCssUrl = webUrl + "SiteAssets/css/CustomerPortalStyle.css";
                    web.SiteLogoUrl = webUrl + "SiteAssets/img/Logo.png";
                    web.Update();
                    context.ExecuteQuery();
                }
0

PowerShell code to update the SuiteBar. Refered from remove the sharepoint label from the suitebar in sharepoint 2013

$app = get-spwebApplication "http://webapplicationGoesHere"
$app.SuiteBarBrandingElementHtml = "<div class='ms-core-brandingText'>Text or space or a logo image element here</div>"
$app.Update()

CSS Class to override would be

.ms-core-brandingText {
    /*Your Style to position logo*/
}

And to attach it to Master Page use below PowerShell

$web = Get-SPWeb http://intranet
$web.AlternateCssUrl = "/Style Library/MyStyles/main.css"
$web.AllProperties["__InheritsAlternateCssUrl"] = $True
$web.Update()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.