The logo is the image displayed, usually in the upper-left corner, on each page in a SharePoint site. Clicking on the logo returns the user to the root home page of the SharePoint site, as shown in the following screenshot:
To complete this recipe you will need an image uploaded or available to upload to the SharePoint site.
Follow these steps to change the site logo:
The site relative URL for the logo image is assigned to the SiteLogoUrl
property of the SPWeb
object representing the site, and the logo description is set to the SiteLogoDescription
property. The SPWeb
object is then saved to the SharePoint database. The logo description will be used as the alternative text for the logo that will be displayed when hovering over the image with a mouse, as well as used by non-standard browsers such as screen readers.
The site logo and description may also be applied with PowerShell or code using the server-side object model.
Follow these steps to change the site logo using PowerShell:
Get-SPWeb
Cmdlet:$web = Get-SPWeb http://sharepoint/site
SiteLogoUrl
property to specify the URL of the image logo and the SiteLogoDescription
property to specify the alternative text for the logo:$web.SiteLogoUrl = "/SiteAssets/logo.png" $web.SiteLogoDescription = "My PowerShell Site"
Update
method to apply the changes:$web.Update()
Dispose
method to discard the SPWeb
object:$web.Dispose()
Follow these steps to change the site logo with code using the server-side object model:
using
statement:using (var site = new SPSite("http://sharepoint/site"))
using
statement:using (var web = site.OpenWeb())
SiteLogoUrl
property to specify the URL of the image logo and the SiteLogoDescription
property to specify the alternative text for the logo:web.SiteLogoUrl = "/SiteAssets/logo.png"; web.SiteLogoDescription = "My PowerShell Site";
Update
method to apply the changes:web.Update();
3.21.46.78