How to Configure Document ID Service Feature in SharePoint Online?

March 27, 2019    , ,
What is Document ID Service in SharePoint Online? Document ID service in SharePoint Online automatically generates and assigns a unique number to each document which can be used to locate that document anywhere within the site collection. Once the uploaded document gets a unique number, a URL is also formed by this unique ID. So, we can use it to quickly find a document within the SharePoint Online site collection even when the document is moved to another location within the same site collection, as the document ID and URL  properties of the document don't change. How to Configure Document ID Feature in SharePoint Online? The Document ID Service is a feature that needs to be activated in SharePoint to provide unique IDs to documents in a site collection. To configure the Document ID Service, do the following: Navigate to the site collection Root >> Click on the "Settings" icon >> Site Information >> View all site settings. On the Site Settings p
How to Configure Document ID Service Feature in SharePoint Online? How to Configure Document ID Service Feature in SharePoint Online? Reviewed by Salaudeen Rajack on March 27, 2019 Rating: 5

SharePoint Online: How to Delete a List Template using PowerShell?

March 26, 2019    , ,
Requirement: Delete list template in SharePoint Online How to delete a list template SharePoint Online? To remove a list template in SharePoint Online, do the following: Login to your SharePoint Online site collection (List templates are scoped at site collection level) >> Click on Settings >> Site Settings On Site Settings Page, Click on "List Templates" under Web Designer Galleries (https://Tenant.sharepoint.com/sites/SiteURL/_catalogs/lt/Forms/AllItems.aspx) Select the list template to delete and click on "Delete Document" from the ribbon Confirm the prompt to delete custom list template in SharePoint Online. SharePoint Online: PowerShell to Delete List Template #Load SharePoint Online Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.
SharePoint Online: How to Delete a List Template using PowerShell? SharePoint Online: How to Delete a List Template using PowerShell? Reviewed by Salaudeen Rajack on March 26, 2019 Rating: 5

SharePoint Online: How to Change the Header Banner Image in Modern Site Pages?

March 24, 2019    ,
Requirement: Change the Header Banner Image in Modern Site Pages How to Change the Header Background image in SharePoint Online Site Page? Here is how to change the default header image on the 'Site Page' on SharePoint Online: Navigate to the modern site page. E.g. https://crescent.sharepoint.com/sites/marketing/SitePages/About-Us.aspx Click on "Edit" button on the top right area.  Click on the top-header area to select it. Click on the little image icon as shown below. You can upload new image, use URL, or select an existing image for banner from the site. Once selected, drag and set a focal point. Save and publish the page. Tips:  Here is the Sharepoint Online modern page banner image size recommendations from Microsoft: Banner Image Size Reference for SharePoint Online PnP PowerShell to Change Banner Image: Here is the PnP PowerShell script to change the banner image in a site page: #Parameter $SiteURL= "https://crescent.sharepoint.com/s
SharePoint Online: How to Change the Header Banner Image in Modern Site Pages? SharePoint Online: How to Change the Header Banner Image in Modern Site Pages? Reviewed by Salaudeen Rajack on March 24, 2019 Rating: 5

SharePoint Online: "Anyone with the link" is Greyed Out

March 24, 2019    ,
Problem: "Anyone with the link" is disabled in SharePoint Online Share window is greyed out! How to Enable Anyone with the link option in SharePoint Online? As a first step, we need to enable sharing with anonymous users at tenant level. Here is how to enable external users with anonymous links in SharePoint Online tenant. Login to Office 365 Admin Center >> SharePoint admin center  Click on "Sharing" from left navigation >>  Set " Sharing outside your organization " to "Allow sharing to authenticated external users and using anonymous access links" Click "OK" to save your changes. PnP PowerShell to Enable Guest Sharing for a Site Collection Once the external sharing with anonymous access is enabled at the tenant level, we have to make sure its enabled at site collection level also. #Parameter $SiteURL= "https://crescent.sharepoint.com/sites/marketing" #Connect to PnP Online Connect-PnPOnline -
SharePoint Online: "Anyone with the link" is Greyed Out SharePoint Online: "Anyone with the link" is Greyed Out Reviewed by Salaudeen Rajack on March 24, 2019 Rating: 5

SharePoint Online: How to Exclude Site from Search Results?

March 23, 2019    , , , ,
Requirement: Exclude Site from Search in SharePoint Online How to Exclude a SharePoint Online Site from Search? SharePoint Online search results are security trimmed by default. Users get search results from all sites where they have access. However, there are some scenarios where you may want to prevent a site to appear in search results, E.g. We've got a document archive site collection for backup purposes, and we don't want results from this site to appear in global search results. Open the SharePoint Online site which you want to prevent to appear in the search result.  Click on Settings Icon and then choose "Site Settings" In Site Settings page, click on the "Search and offline availability" link under the "Search" section. Set the "Allow this site to appear in search results?" option to "No" in the Indexing Site Content section, Then click on OK. These changes take effect after the next crawl - The site and
SharePoint Online: How to Exclude Site from Search Results? SharePoint Online: How to Exclude Site from Search Results? Reviewed by Salaudeen Rajack on March 23, 2019 Rating: 5

How to Decode a SharePoint Online URL using PowerShell?

March 05, 2019    ,
Requirement: Decode a URL in SharePoint Online PowerShell to Decode URL: We need decoded URLs in various scenarios in SharePoint. Say, we want to pass the file URL as parameter to some function. #Parameter $URL = "https%3A%2F%2Fcrescent.sharepoint.com%2Fsites%2Fmarketing%2F2018%2FDocuments%2FInfo%20Mgmt%20v2%2Epdf" #Decode URL [System.Web.HttpUtility]::UrlDecode($URL) Decode SharePoint Online URL using PowerShell: We can also use SharePoint Online method:   #Import PoweShell Module for SharePoint Online Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking #Function to Decode URL Function Decode-URL([string]$URL) { Try { #Decode the URL Return [Microsoft.SharePoint.Client.Utilities.HttpUtility]::UrlKeyValueDecode($URL) } catch { Return "Error Getting De-codedURL: $($_.Exception.Message)" } } #Parameter $URL = "https%3A%2F%2Fcrescent.sharepoint.com%2Fsites%2Fmarketing%2F2018%2FShared%20Docume
How to Decode a SharePoint Online URL using PowerShell? How to Decode a SharePoint Online URL using PowerShell? Reviewed by Salaudeen Rajack on March 05, 2019 Rating: 5

SharePoint Online: Get Site Title using PowerShell

March 04, 2019    , , ,
Requirement: Get SharePoint Online site title using PowerShell SharePoint Online: Get Site Title using PowerShell Let's use PowerShell CSOM script to get site title in SharePoint Online. #Parameters $AdminSiteURL = "https://crescent-admin.sharepoint.com" $SiteURL = "https://crescent.sharepoint.com/sites/marketing" #Connect to SharePoint Online Connect-SPOService -Url $AdminSiteURL -Credential (Get-Credential) #Get the Site Collection $Site = Get-SPOSite -Identity $SiteURL #Get Site Collection Title Write-host $Site.Title PowerShell to Get Site Collection Title  We can also use this PowerShell script at tenant level to get site title. #Import PoweShell Module for SharePoint Online Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking #Parameter $SiteUrl = "https://crescent.sharepoint.com/sites/marketing" #Get Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = New-Object Microsoft.Sha
SharePoint Online: Get Site Title using PowerShell SharePoint Online: Get Site Title using PowerShell Reviewed by Salaudeen Rajack on March 04, 2019 Rating: 5

Fix "List cannot be deleted while on hold or retention policy" Error on SharePoint Online

March 04, 2019    , , , , , ,
Problem:   When trying to delete a document library in SharePoint Online, it gave an error message "list cannot be deleted while on hold or retention policy." Solution:  As the error message says: List cannot be deleted while on hold or retention policy, this error is due to the site is under hold or retention policy. So, to delete the list you must delete all its files and sub-folders first. Otherwise, you should remove the retention policy under Office 365 compliance center. You can quickly check if the site is under hold by going to: Admin centers >> Security & Compliance >> Search & investigation Click on eDiscovery, check if you have created any case. >> If you see any case, click Open Under Hold, Check if you see any site.   Deleting files at each folder could be haunting especially when you have a deep folder structure. Fortunately, we've PowerShell to relive the burden. PowerShell to Clear Document Library's Content and
Fix "List cannot be deleted while on hold or retention policy" Error on SharePoint Online Fix "List cannot be deleted while on hold or retention policy" Error on SharePoint Online Reviewed by Salaudeen Rajack on March 04, 2019 Rating: 5

SharePoint Online: Set Active Directory Security Group as Site Collection Administrator using PowerShell

March 03, 2019    , , , ,
Requirement: Add active directory security group to SharePoint online site collection administrator group. PowerShell to Add AD Security group as Site Collection Administrator: Step 1: Get AD Security Group's ID We need the ID of the AD group first. Use the PowerShell script to retrieve the ID, make sure you have Azure AD module installed. $GroupName = "Opera" #Connect to Azure AD Connect-AzureAD -Credential (Get-Credential) #Get Security Group's SID Get-AzureADGroup -SearchString $GroupName | Select DisplayName, ObjectId | Format-table This script gets IDs of all AD security groups with given name. Copy the ID for the group. Step 2:  Step 2: Add Active Directory Group to SharePoint Online Site Collection Administrator's Group Now, Use this PowerShell script to add the AD group as site collection administrator #Variables $AdminURL = "https://crescent-admin.sharepoint.com/" $SiteURL = "https://crescent.sharepoint.com/sites/marketing&q
SharePoint Online: Set Active Directory Security Group as Site Collection Administrator using PowerShell SharePoint Online: Set Active Directory Security Group as Site Collection Administrator using PowerShell Reviewed by Salaudeen Rajack on March 03, 2019 Rating: 5

SharePoint Online: Get Document Library Inventory (Folder-SubFolder-File Structure) using Powershell

March 03, 2019    , , , , , , ,
Requirement: Get the file-folder structure of a SharePoint document library and export to CSV. SharePoint Online: PowerShell to get the Document Library Inventory Let's export all folders, sub-folders and files structure from a SharePoint Online document library to a CSV file: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Config Parameters $SiteURL= "https://crescent.sharepoint.com/sites/marketing" $ListName = "Documents" $CSVPath = "C:\Temp\DocumentLibraryRpt.csv" $BatchSize = 500 #Get Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microso
SharePoint Online: Get Document Library Inventory (Folder-SubFolder-File Structure) using Powershell SharePoint Online: Get Document Library Inventory (Folder-SubFolder-File Structure) using Powershell Reviewed by Salaudeen Rajack on March 03, 2019 Rating: 5

Fix "Get-PnPListItem : The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator." Error

March 03, 2019    , ,
Problem:  When trying to get list items from a SharePoint Online list using Get-PnPListItem cmdlet with a query parameter, got an error message "Get-PnPListItem : The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator." Root Cause:  The requirement was to get all list items created 90 days ago. So, I was trying to fetch list items by applying Query filter. As the error message states, This error is caused by a large with with more than 5000 items! Here is the PowerShell script caused the above error message: #Parameter $SiteURL= "https://crescent.sharepoint.com/sites/Projects" $ListName = "Meetings" #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -UseWebLogin #Define Query to Filter items created 90 days ago $Query= "<View> <Query> <Where> <Lt> <FieldRef Name='Created' Type=
Fix "Get-PnPListItem : The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator." Error Fix "Get-PnPListItem : The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator." Error Reviewed by Salaudeen Rajack on March 03, 2019 Rating: 5

SharePoint Online: How to Change Site Theme using PowerShell?

March 02, 2019    , , , , ,
In SharePoint Online you can customize the look and feel of your site by changing themes to reflect your corporate branding. A theme in SharePoint Online defines the colors, fonts, image, and page layout for the SharePoint sites. SharePoint provides a default set of site themes,  and we also have the ability to create and deploy our custom themes as well. How to Change the Theme SharePoint Online ? To change a theme for a site, do the following: Navigate to the SharePoint Online site where you want to change the theme >> On the site’s home page, Click on Settings gear >> Choose "Change the look" from the Site Settings menu. On the Change the Look page, select the theme to use as the starting point for the new site layout. (You can also go to Site Settings >> Click on "Change the Look" link from the Look and Feel section) On the Change the Look configuration page, you can further customize the theme to meet your requirements, such as:
SharePoint Online: How to Change Site Theme using PowerShell? SharePoint Online: How to Change Site Theme using PowerShell? Reviewed by Salaudeen Rajack on March 02, 2019 Rating: 5

SharePoint Online: Enable Document ID Service using PowerShell

March 02, 2019    , , , ,
Document ID Service feature automatically assigns a unique ID to documents uploaded which helps to track and manage documents easily. Configuring document ID service is explained in my other post How to Configure Document ID Service Feature in SharePoint Online? , Here, let's see how to enable document ID service using PowerShell: Step 1: Activate Document ID Feature in SharePoint Online As a first step to enable document ID, we need to activate a feature in the site collection. #Parameters $SiteURL = "https://crescent.sharepoint.com/sites/Sales" $FeatureId = "b50e3104-6812-424f-a011-cc90e6327318" #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #Get the Feature $Feature = Get-PnPFeature -Scope Site -Identity $FeatureId #Get the Feature status If($Feature.DefinitionId -eq $null) { #enable document id feature in sharepoint online using powershell Write-host -f Yellow "Activating Document ID Service F
SharePoint Online: Enable Document ID Service using PowerShell SharePoint Online: Enable Document ID Service using PowerShell Reviewed by Salaudeen Rajack on March 02, 2019 Rating: 5

Search SharePoint Online using PnP PowerShell

March 01, 2019    , ,
Requirement: Run Search Query in SharePoint Online using PowerShell How to Search SharePoint Online using PowerShell? Using Keyword query to execute search and export results to CSV with CSOM is explained in my other post:  How to Search SharePoint Online using PowerShell-Keyword Query? , Now, I need to get the List Item ID of the latest item created in a SharePoint Online list: #Config Variables $SiteURL = "https://crescent.sharepoint.com/sites/DocHub" $ListURL= "https://actisportal.sharepoint.com/sites/DocHub/Documents" $SearchQuery = "Path:" + $ListURL #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -UseWebLogin #Perform Search $SearchResults = Submit-PnPSearchQuery -Query $SearchQuery -All -SelectProperties ListItemID -SortList @{Created="Descending"} #Get the Last Created Item's ID Write-host "The Latest Item ID is:" $SearchResults.ResultRows[0]["ListItemID"] PnP PowerShell to Search SharePoint
Search SharePoint Online using PnP PowerShell Search SharePoint Online using PnP PowerShell Reviewed by Salaudeen Rajack on March 01, 2019 Rating: 5
Powered by Blogger.