SharePoint Online: User Permissions Audit Report for a Site Collection using PnP PowerShell

September 25, 2019    , , , ,
Requirement: Need a report to audit SharePoint Online site collection permissions. SharePoint Online: User Permissions report in a Site Collection using PnP PowerShell Auditing SharePoint Online Site permissions is critical for security as misconfigured permissions may enable users to access to data that they should not have access to. So, regular auditing of SharePoint permissions is crucial to minimizing the risk of data leaks and compliance violations. As there are no out of the box ways to generate permissions report, we can utilize PowerShell get list of effective permissions for your SharePoint site collections. This PowerShell script generates permission report on all objects such as SharePoint Online Site collection and its subsites, lists and libraries, folders and list items which has unique permissions on the given site collection. It scans through following securables: Site collection administrators group Given site collection and sub-sites with unique permissions
SharePoint Online: User Permissions Audit Report for a Site Collection using PnP PowerShell SharePoint Online: User Permissions Audit Report for a Site Collection using PnP PowerShell Reviewed by Salaudeen Rajack on September 25, 2019 Rating: 5

Migrate SharePoint 2010 Document Libraries to SharePoint Online using PowerShell

June 16, 2019    , , , , , ,
Requirement: Migrate Document Libraries from SharePoint 2010 to SharePoint Online. How to Migrate SharePoint 2010 Document Libraries to SharePoint Online? The idea is: Export all document libraries from SharePoint On-premises to local drive, export metadata of each document to a CSV file and then Import them to SharePoint Online. Before we begin, Please note, this is not a full fledged migration script which can migrate metadata, security, version history, etc. This script only copies document libraries with its file-folders and metadata "Created by", "Created On", "Modified By", "Modified On" to SharePoint Online. You need 3rd party migration tools if you want migrate all missing pieces! Step 1: Export SharePoint On-Premises Document Library As a first step, Login to any of your SharePoint On-premises web front end server and run the below PowerShell script to export either a single document library or all document libraries from ShareP
Migrate SharePoint 2010 Document Libraries to SharePoint Online using PowerShell Migrate SharePoint 2010 Document Libraries to SharePoint Online using PowerShell Reviewed by Salaudeen Rajack on June 16, 2019 Rating: 5

SharePoint Online: Change UI to Modern Experience or Classic Experience using PowerShell

May 19, 2019    , ,
Requirement: Change Classic Experience to Modern Experience and Modern UI to Classic in SharePoint Online. How to Activate Modern Experience from Classic? The modern experience in SharePoint Online lists and libraries is faster, mobile friendly and easier to use.  It brings new functionalities and components, However, some features can only be used in the classic experience. So, you may need to switch between modern UI and classic experience in SharePoint Online. To enable modern experience in SharePoint Online, use the link "Exit classic Experience" at the bottom left corner. This turns ON modern experience. To disable modern experience and switch back to classic in SharePoint Online use the link "Return to Classic SharePoint" PowerShell to Switch Between Modern Experience and Classic Experiences To enable modern experience, we have to disable classic experience feature and to disable modern experience we should re-enable the classic experience feature
SharePoint Online: Change UI to Modern Experience or Classic Experience using PowerShell SharePoint Online: Change UI to Modern Experience or Classic Experience using PowerShell Reviewed by Salaudeen Rajack on May 19, 2019 Rating: 5

SharePoint Online: Find Duplicate Files using PowerShell

April 23, 2019    , ,
Requirement: Find Duplicate Documents in SharePoint Online. When multiple people from different teams work together, there is a huge possibility for duplicate content in SharePoint. People may have uploaded a same document to different libraries or even different folders in document libraries. So, How to find duplicate documents in SharePoint Online? SharePoint Online: Find Duplicate Documents using PowerShell - File Hash Method Lets find duplicate files in a SharePoint Online document library by comparing File hash. #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" #Parameters $SiteURL = "https://crescenttech.sharepoint.com" $ListName ="Documents" #Array to Results Data $DataCollection = @()
SharePoint Online: Find Duplicate Files using PowerShell SharePoint Online: Find Duplicate Files using PowerShell Reviewed by Salaudeen Rajack on April 23, 2019 Rating: 5

How to Get Office 365 Group Members using PowerShell?

April 07, 2019    ,
Requirement: Get Members of Office 365 Group using PowerShell How to Get Office 365 Group Members? To get a list of members in Office 365 group from Microsoft 365 admin center, Login to the Microsoft 365 Admin Center site: https://admin.microsoft.com Expand Groups and Click on Groups link in the left navigation.  Groups page lists all groups in your Office 365 tenant. Pick the desired group to list users in group. This opens the group's details page which lists group members PowerShell to Get Group Members in Office 365: Here is the Office 365 PowerShell get group members #Get Credentials to connect $Credential = Get-Credential #Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $Credential -Authentication Basic -AllowRedirection #Import the session Import-PSSession $Session -DisableNameChecking #Get all Members of Office 365 Group Get-Unifie
How to Get Office 365 Group Members using PowerShell? How to Get Office 365 Group Members using PowerShell? Reviewed by Salaudeen Rajack on April 07, 2019 Rating: 5

SharePoint Online: How to Implement Custom 404 Page Not Found Error Page?

February 28, 2019    , ,
Requirement: Implement a custom page not found error page in SharePoint Online. SharePoint Online: How to Add custom 404 page not found error page SharePoint Online comes with a default "Page not found" error page in "Pages" library in publishing Sites (http://crescent.sharepoint.com/Pages/PageNotFoundError.aspx) which works automatically when a user hits a non-existent URL. This error page works for the entire site collection. You can further customize this page, located at "/Pages/PageNotFoundError.aspx" to add some descriptive text, images and branding. In some cases, You may need to create your own 404 page and here are the steps: Step 1: Add New Page Not Found Error Page in SharePoint Online:  We can create our own page and set as a page not found error page for any SharePoint Online site collection. Here are the steps to create a custom 404 page not found error page: Go to Site Contents >> Pick Pages Library and Create New >&g
SharePoint Online: How to Implement Custom 404 Page Not Found Error Page? SharePoint Online: How to Implement Custom 404 Page Not Found Error Page? Reviewed by Salaudeen Rajack on February 28, 2019 Rating: 5

SharePoint Online: How to Add a Custom Refiner to Refinement Panel in Search Results?

February 28, 2019    ,
Requirement: Create Search Refiners in SharePoint Online. How to Add a Custom Column in Search Refiner in SharePoint Online? Refinement Web Part in SharePoint Online search results page helps us to narrow down the search results. By default, the refinement panel has Result type, Author and Modified Date columns in it. In my case, We have a document library with "IC Number" and "Project Name" Columns, which I would like to show in the Refinement Panel on the Search Results. Make sure your document library is already crawled by search, so that we have crawled properties for metadata columns in the document library created. Here are the steps to add a custom refiner to SharePoint Online Search results: In Short: Map a crawled property of list column to any one of the Built-it "RefinableString..." managed property and Edit the Refinement web part in Search Results page to include the Metadata property in Refiners! Step 1: Map Crawled Property wit
SharePoint Online: How to Add a Custom Refiner to Refinement Panel in Search Results? SharePoint Online: How to Add a Custom Refiner to Refinement Panel in Search Results? Reviewed by Salaudeen Rajack on February 28, 2019 Rating: 5

SharePoint Online: Add Metadata to Search Results Page

February 26, 2019    ,
Requirement: Add Metadata to SharePoint Online Search Results SharePoint Online: How to Show Metadata in Search Results? I've a requirement to add "Project Name" column value of a document in search results. Followed these steps to add metadata properties (or custom columns) to search results page of SharePoint Online: Activate Publishing Feature both at Site collection features and Site Features page. Get the Managed Property name for your list column. You can verify it from Site settings >> Click on "Search schema "under "Site Collection Administration" section. Use search to enter the name of your property, verify its mapping. In my case, I've "ProjectName" Site column added to my list and its respective managed property was created automatically as: "ProjectNameOWSTEXT". Open the site collection in SharePoint Designer, Navigate to folder "Search" folder under "Display Templates". E.g. https:/
SharePoint Online: Add Metadata to Search Results Page SharePoint Online: Add Metadata to Search Results Page Reviewed by Salaudeen Rajack on February 26, 2019 Rating: 5

Get All Document Libraries in SharePoint Online using PnP PowerShell

February 16, 2019    , , ,
Requirement: Get all document libraries in SharePoint Online using PowerShell PnP PnP PowerShell to Get All Document Libraries in SharePoint Online  Document libraries can be filtered from Lists collection by either base template or base type properties. Here is how: #Set Variables $SiteURL = "https://crescent.sharepoint.com/sites/marketing" #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #-UseWebLogin #Get all document libraries - Exclude Hidden Libraries $DocumentLibraries = Get-PnPList | Where-Object {$_.BaseTemplate -eq 101 -and $_.Hidden -eq $false} #Or $_.BaseType -eq "DocumentLibrary" #Get Document Libraries Name, Default URL and Number of Items $DocumentLibraries | Select Title, DefaultViewURL, ItemCount This PowerShell script gets all document libraries from the given site URL Here is my another script to get all document libraries in SharePoint Online site using CSOM PowerShell:  SharePoint Online: PowerShel
Get All Document Libraries in SharePoint Online using PnP PowerShell Get All Document Libraries in SharePoint Online using PnP PowerShell Reviewed by Salaudeen Rajack on February 16, 2019 Rating: 5

Set SharePoint Online Site to Read Only using PowerShell

February 15, 2019    , , ,
Requirement: Set SharePoint Online site to read only using PowerShell. How to make SharePoint Online site read only?  To make SharePoint online site collection to read only, use this PowerShell script in SharePoint Online Management Shell. #Set Parameters $AdminCenterURL="https://crescent-admin.sharepoint.com" $SiteURL = "https://crescent.sharepoint.com/sites/marketing" #Connect to SharePoint Online Connect-SPOService -Url $AdminCenterURL -Credential (Get-Credential) #PowerShell to set sharepoint online site to read only Set-SPOSite -Identity $SiteURL -LockState ReadOnly Once the execution of the above script is completed, you'll find a message appearing on top of the site: "SharePoint sites are read-only right now while we do some maintenance. We apologize for the inconvenience." To unlock the site collection, use: #Unlock site from read only mode Set-SPOSite -Identity $SiteURL -LockState Unlock Here is my another post on making site r
Set SharePoint Online Site to Read Only using PowerShell Set SharePoint Online Site to Read Only using PowerShell Reviewed by Salaudeen Rajack on February 15, 2019 Rating: 5

SharePoint Online: Get Document Library Permissions and Export to CSV using PnP PowerShell

February 15, 2019    , , , , ,
Requirement: SharePoint Online PowerShell to Get Document Library Permissions. PnP PowerShell to Export Document Library Permissions in SharePoint Online: This PowerShell script exports all permissions of a SharePoint Online document library. # Parameters $SiteUrl = "https://crescent.sharepoint.com/sites/ICDocuments" $ReportOutput = "C:\Temp\LibraryPermissions.csv" $LibraryName = "IC Documents" #Connect to to PnP Online Connect-PnPOnline -Url $SiteUrl -UseWebLogin # -Credentials (Get-Credential) # Get the document library $Library = Get-PnpList -Identity $LibraryName -Includes RoleAssignments # Get all users and groups who has access $RoleAssignments = $Library.RoleAssignments $PermissionCollection = @() Foreach ($RoleAssignment in $RoleAssignments) { #Get the Permission Levels assigned and Member Get-PnPProperty -ClientObject $roleAssignment -Property RoleDefinitionBindings, Member #Get the Principal Type: User, SP Group, AD Group
SharePoint Online: Get Document Library Permissions and Export to CSV using PnP PowerShell SharePoint Online: Get Document Library Permissions and Export to CSV using PnP PowerShell Reviewed by Salaudeen Rajack on February 15, 2019 Rating: 5

SharePoint Online: Get List Item Count using PowerShell

February 14, 2019    , , , , , ,
Requirement: Get list item count in SharePoint Online using PowerShell How to Get List Items Count in SharePoint Online? The "Site Contents" page in SharePoint Online gives you all lists and number of items in each. E.g. https://YourTenant.sharepoint.com/_layouts/Viewlsts.aspx SharePoint Online: PowerShell to Get List Item Count Use this CSOM PowerShell script to find the number of items in a SharePoint Online list. #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" #Setup Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = New-Object Microsof
SharePoint Online: Get List Item Count using PowerShell SharePoint Online: Get List Item Count using PowerShell Reviewed by Salaudeen Rajack on February 14, 2019 Rating: 5
Powered by Blogger.