SharePoint Online: Get All Site Collections using PowerShell

Requirement: Get all site collections using PowerShell in SharePoint Online. How to Get a List of Site Collections in SharePoint Online? A site collection is a group of sites, generally organized by department, project, region, function, or business units. If you want to get a list of SharePoint Online site collections, you…

Read more

SharePoint Online: PowerShell to Get All Subsites in a Site Collection

Requirement: PowerShell to list all subsites in a SharePoint Online Site collection. SharePoint Online: Get All Subsites using PowerShell How to get all subsites in a site collection in SharePoint Online? To get all subsites of a site (either a top-level site or sub-site), use this PowerShell: This PowerShell script gets all…

Read more

Get Site Collection Administrators of All SharePoint Sites using PowerShell

Requirement: Get all Site collection Administrators of a SharePoint 2016 site collection. Site Collection Administrators in SharePoint SharePoint site collection administrators possess full control of the entire site collection – including top-level site, subsites, and all lists and libraries in the site collection. SharePoint 2016 site collection Administrators as assigned at site…

Read more

SharePoint 2013 Search: Unable to retrieve topology component health states. This may be because the admin component is not up and running

Problem: SharePoint 2013 Search service application displays the error message “Unable to retrieve topology component health states. This may be because the admin component is not up and running” Solution: After making sure the account configured to run search service & Search Service Host in the Services console, (Service.msc), Provisioned the Usage…

Read more

SharePoint Online: Delete Version History using PowerShell

The versioning feature in SharePoint Online allows you to access previous copies of a document or list items. By default, versioning is enabled on your SharePoint Online document libraries. When a user makes edits, SharePoint automatically creates a new version with metadata such as created by, Timestamps, etc. How to Delete Version…

Read more

How to Create a Site Collection in SharePoint using PowerShell?

We have to use New-SPSite cmdlet to create a site collection in SharePoint. It takes URL and Owner parameters as mandatory with several other parameters. Here is an example: PowerShell to Create New Site Collection in SharePoint 2016: To create a site collection using PowerShell in SharePoint 2013, use this script. Create…

Read more

SharePoint Online: Delete Unique Permissions for All Items in a List using PowerShell

Requirement: Reset all customized permissions in all documents of a SharePoint online document library. By default, Permissions are inherited from their parent in all levels of SharePoint. E.g. Site inherits permissions from its parent site collection (or parent site), lists and libraries inherits permissions from the site, items in the list inherits…

Read more

PowerShell-CAML SPQuery to Filter List Items based of Person or Group Field Value

Requirement:In a project tracking SharePoint list, want to quickly get the list of projects where a particular user is listed as Project Manager – person or group (People picker) field. Solution: Use SPQuery with PowerShell as in the below example. PowerShell to Filter List Items based on Person or Group Field:

Read more

Import Data from SQL Server Table to SharePoint List using PowerShell

Requirement: We’ve an External CRM application from which data is to be extracted and inserted into a SharePoint List! PowerShell to Read Data from SQL Server and Insert into SharePoint: We created a new list “Projects” mapping relevant columns as per the SQL Server table and then here is my PowerShell script…

Read more