none
How to change Icon for Document Library

    Question

  • Dear all,

    On my sharepoint online, team sites are already created.

    I want to change the Icons of Document library to new images. i am trying to use many methods but could not succeed. As per microsoft, this is customised link may be made in Sharepoint designer, which is out of their support boundary. 

    so guys, can you help me out related to my issue.


    Kunal Rane

    Tuesday, December 20, 2016 4:49 AM

All replies

  • Hi Kunal Rane,

    You could using the following PowerShell cmdlet to change the image of the document library in SharePoint Online.

    Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" 
    
    Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    
    # Specify tenant admin and site URL
    
    $SiteUrl = "https://<site>"
    
    $ListName = "<document library>"
    
    $UserName = "<account>"
    
    $SecurePassword = Read-Host -Prompt "Enter password" -AsSecureString
    
    # Connect to site
    
    $ClientContext = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
    
    $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword)
    
    $ClientContext.Credentials = $credentials
    
    $ClientContext.ExecuteQuery()
    
    # Get List and List Items
    
    $List = $ClientContext.Web.Lists.GetByTitle($ListName)
    
    $ListItems = $List.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery())
    
    $ClientContext.Load($List)
    
    $ClientContext.ExecuteQuery()
    
    # Change the image
    
    $List.ImageUrl = "/_layouts/15/images/ltgen.png?rev=44"
    
    $List.Update()


    Wait for a while, and then refresh the page, the image will be changed.

    Note: Before you get started using PowerShell to manage SharePoint Online, please make sure that the SharePoint Online Management Shell is installed.

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, December 21, 2016 7:55 AM
  • Hi Kunal Rane,

    How are things going?

    I am checking to see how things are going there on this issue. Please let us know if you would like further assistance.

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, December 26, 2016 9:44 AM