In this blog post, we will explore a tool called UI Experience Scanner that was released by PnP Team last year. If you are considering modernization of SharePoint Online Classic sites, then you should give a try to this tool. So well lets start on what it does, how it works etc. etc.
What this tool does ?
It generates a report of sites, list, libraries or any other customization that will not work after modernization based on if we are scanning the whole tenant or a set of sites.
These reports can be used to identify which entities does not support modern experience, what is the reason or cause that a list or library is falling back to classic experience etc.
How to launch the tool ?
First of all you need to download the tool from here. This downloads a zip which you need to extract to a location. Then launch PowerShell and navigate to the folder where extracted tool “UIExperienceScanner.exe” is present.
How to use the tool ?
This tool allows to connect in two ways –
- Using Credentials (Preferable if only those sites need to be scanned to which user has access)
- Using App-Only Principal (All sites can be scanned with tenant scoped permission)
Using Credentials – In PowerShell window, type below command
.\UIExperienceScanner.exe -t <tenant name> -u <user name> -p <password>
Using App-Only Principal – First we need to set up the principal by navigating to URL https://so365dev.sharepoint.com/_layouts/15/appregnew.aspx. Any site url can be used.)
On this page, for first textbox, click Generate button to generate Client Id and then second Generate button to generate Client Secret.
Provide values for Title (any text), App Domain (use http://www.localhost.com) and Redirect URI (use https://www.localhost.com). Click Create button. (Note– Make sure to note down the Client Id and Secret generated to use in next step).
Now we need to grant permission to the principal. If we are targeting tenant scoped permission, navigate to tenant admin URL https://so365dev-admin.sharepoint.com/_layouts/15/appinv.aspx, else navigate to site url https://so365dev.sharepoint.com/_layouts/15/appinv.aspx for Site scoped permission.
On this page, provide Client Id generated in previous step for App Id and click Lookup button. Other details will populate automatically. For permission request XML, paste below code-
Click Create button. On the next screen, click “Trust It” button to grant permission.
Now in the PowerShell window, type below command-
.\UIExperienceScanner.exe -t <tenant name> -c <clientid> -s <clientsecret> //clientid and clientsecret to be used from previous steps
By following either of the above mentioned ways, command execution starts and tool displays entities being scanned-
Once scanning is complete, it also creates a folder at the current location (where exe is placed). This folder contains files which are basically reports created after scanning. Every time a scan is run, a new folder is created for that particular scan data.
Brief overview of the reports generated
|IgnoredCustomizations_MasterPage.csv||This contains list of sites which are having custom master pages|
|IgnoredCustomizations_CustomAction.csv||This contains list of custom actions which are ignored on modern experience|
|IgnoredCustomizations_AlternateCSS.csv||This contains list of sites where AlternateCssUrl property is set|
|IgnoredCustomizations.csv||This contains a summary of the above three files and allows to better understand which of our customizations require review/rework to be compatible with modern experience.|
|ModernListBlocked.csv||There can be many reasons like JS Link, Custom Actions, Managed Metadata etc. which restricts a list/library to render in modern UI. This file contains all those lists along with reason which are blocked from modern experience. For more info check MSDN.|
|ModernPagesBlocked.csv||This file contains all site where modern pages are not enabled. For more info check MSDN|
|ScannerSummary.csv||This files logs the count of sites, web and lists scanned and the duration of scan. It also logs the version of scanner used.|
|Errors.csv||This file is generated only if any errors are encountered by the tool during scan.|
|Modern UI List Readiness.xlsx||This excel file helps in analyzing the data delivered by the above csv files. It uses PowerQuery and PowerPivot for data analysis.|
Other Tool Usage Examples
- Scan Only Few Sites – This tool can be used to scan only a set of sites being considered for modernization using below commands-
.\UIExperienceScanner.exe -r <Site URL 1>,<Site URL 2> -c <clientid> -s <clientsecret> // here -r allows to use a set of wildcard urls .\UIExperienceScanner.exe -f "c:\temp\files.csv" -c <clientid> -s <clientsecret> //here -f allows to refer the set of urls from a csv file
- Partial Scan – As we saw that after scanning, tool generates a set of files that allows to determine the feasibility or approach for modernization. Sometimes it is required to check only for few things like we just want to check all sites where only customizations are ignored for modern pages. In such scenarios, this tool can be used to perform only a partial scan using below command-
.\UIExperienceScanner.exe -m IgnoredCustomizations -t <tenant name> -c <clientid> -s <clientsecret> //here -m defines mode for partial scan (Default is Scan)
- Help – To explore all the the attributes that can be used, run below command-
.\UIExperienceScanner.exe --help // this display all attributes available along with examples
Please leave a feedback to help me improve future posts.