SharePoint Online: Copy Attachments from List to Document Library using PowerShell

Requirement: Copy all attachments from a SharePoint Online List to Document Library How to Copy Attachments from SharePoint Online List? Here is the trick to copy all attachments from the SharePoint Online list: SharePoint stores list item attachments by creating sub-folders for each list item based on the item id under a…

Read more

SharePoint Online: How to Set Value and Disable a Field in List New Form?

Requirement: Disable a Field in SharePoint Online List New Form (NewForm.aspx). How to Set Value and Disable a Field in New Form? I had to fill a few field values from the URL query string and disable those fields in SharePoint Online New Form. My URL for New form would like: https://crescent.sharepoint.com/lists/ack/NewForm.aspx?ID=1&DeviceType=Monitor…

Read more

How to Encode-Decode a SharePoint Online URL using PowerShell?

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 a parameter to some function. Decode SharePoint Online URL using PowerShell: We can also use SharePoint Online method:  In another situation, I had…

Read more

Fix: “The Site scoped feature being activated has a dependency on hidden Site Collection scoped feature” Error on Content Organizer

Problem: I need to enable ‘content organizer’ in site feature. However, when I tried activating the “Content Organizer” feature from SharePoint Online site features page, got an error message: The Site scoped feature being activated has a dependency on hidden Site Collection scoped feature ‘FeatureDefinition/15/0c8a9a47-22a9-4798-82f1-00e62a96006e’ (ID: ‘0c8a9a47-22a9-4798-82f1-00e62a96006e’). Hidden features cannot be auto-activated across…

Read more

SharePoint Online: Get Site Title using PowerShell

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. PowerShell to Get Site Collection Title We can also use this PowerShell script at the site level to get the site name. Retrieve SharePoint Online…

Read more

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

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…

Read more

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

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…

Read more

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

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: Get File-Folder Structure in a Document Library using PnP PowerShell Similarly,…

Read more

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

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…

Read more

SharePoint Online: How to Change Site Theme using PowerShell?

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…

Read more