This article outlines the steps to track the site collections in your SharePoint tenancy where ShortPoint is installed, using Windows PowerShell commands.
TABLE OF CONTENTS
- Prerequisites
- Step 1. Launch Windows PowerShell
- Step 2. Download PnP PowerShell
- Step 3. Connect to SharePoint tenant
- Step 4. Enter Site URL and credentials
- Step 5. Run command script
- Results
- How do I run the command if I already have the PnP PowerShell module installed?
Prerequisites
- You installed ShortPoint in one or more of your SharePoint sites.
- You have the appropriate permissions to run Windows PowerShell commands on your SharePoint tenancy.
- You are a Global Administrator or equivalent on your SharePoint tenancy.
Step 1. Launch Windows PowerShell
Search for the Windows PowerShell ISE application and choose Run as administrator.
The Windows PowerShell ISE will launch.
Step 2. Download PnP PowerShell
The PnP Powershell module is needed to run the command to pull the sites that have ShortPoint. Copy the code below, paste it on the cursor, and hit Enter.
# Check if the PnP.PowerShell modle has been installed Try { Write-host "Checking if PnP PowerShell Module is Installed..." -f Yellow -NoNewline $PnPModule = Get-Module PnP.PowerShell If(!$PnPModule) { Write-host "PnP PowerShell module is not installed." -f Green #Check if script is executed under elevated permissions - Run as Administrator If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Write-Host "Please Run this script in elevated mode (Run as Administrator)! " -NoNewline Read-Host "Press any key to continue" Exit } Write-host "Installing PnP PowerShell Module..." -f Yellow -NoNewline Install-Module PnP.PowerShell -Force -Confirm:$False Write-host "Done!" -f Green } Else { Write-host "Yes!" -f Green Write-host "Importing PnP PowerShell Module..." -f Yellow -NoNewline Import-Module PnP.PowerShell -DisableNameChecking Write-host "Done!" -f Green } } Catch{ write-host "Error: $($_.Exception.Message)" -foregroundcolor red }
If you encounter a pop-up window asking to install a NuGet provider, click Yes to install it.
Wait for the indicator to state that the installation is done.
Step 3. Connect to SharePoint tenant
To connect to the SharePoint tenancy you want to check, copy this command, paste it on the cursor, and hit Enter:
Connect-PnPOnline -Url "yourtenantname.sharepoint.com" -Interactive
Replace yourtenantname with your tenancy's name.
This will open a Windows log-in session. Enter your credentials:
When asked, accept the required permissions:
A new command line will appear when this step is completed.
Step 4. Enter Site URL and credentials
Use this code to indicate the SharePoint tenancy URL and to enter your credentials. Copy the code, paste it on the command line, and hit Enter.
$tenantName = Read-Host -Prompt 'Enter your sharepoint tenant name' #Set Parameter $TenantSiteURL="https://$tenantName.sharepoint.com" $credentials = Get-Credential
When a prompt appears, enter your tenant URL and hit Enter.
This will open a log-in window. Enter your credentials and hit OK.
A new command prompt will appear when you have successfully entered your credentials.
Step 5. Run command script
Copy the command script below that would retrieve the SharePoint sites with ShortPoint installed.
Connect-PnPOnline $TenantSiteURL -Credentials $credentials #sharepoint online pnp powershell get all sites $siteCollections = Get-PnPTenantSite foreach ($siteCollection in $siteCollections) { Try { $connection = Connect-PnPOnline $siteCollection.Url -Credentials $credentials $web = Get-PnPWeb –Includes AppTiles $appTiles = $web.AppTiles | Where-Object {$_.Title -eq "ShortPoint SPFx"} if ($appTiles.Count -gt 0) { Write-Output $web.Url } } Catch{ write-host "Error Connecting: $siteCollection.Url" -foregroundcolor red } }
And paste it on the cursor.
Results
Let the command run and list SharePoint site URLs, and that's it! You now have a list of all site collections that have ShortPoint.
Important: Once you see an error like the example below, it means that the credentials you used to connect to your tenant does not have access to that specific site:
How do I run the command if I already have the PnP PowerShell module installed?
If you already have the PnP PowerShell Module installed on your machine, then you can proceed with running the codes below:
Step 1. Connect to your SharePoint tenant
Copy the code below:
Connect-PnPOnline -Url <SiteURL> -Credentials (Get-Credential)
Replace <SiteURL> with the URL of your SharePoint tenant and press the Enter key.
Step 2. Logging into your tenant
After pressing the enter key, log in using your credentials, then press the OK button.
Step 3. Run the command script
Paste the code to the cursor and press the Enter key.
Connect-PnPOnline $TenantSiteURL -Credentials $credentials #sharepoint online pnp powershell get all sites $siteCollections = Get-PnPTenantSite foreach ($siteCollection in $siteCollections) { Try { $connection = Connect-PnPOnline $siteCollection.Url -Credentials $credentials $web = Get-PnPWeb –Includes AppTiles $appTiles = $web.AppTiles | Where-Object {$_.Title -eq "ShortPoint SPFx"} if ($appTiles.Count -gt 0) { Write-Output $web.Url } } Catch{ write-host "Error Connecting: $siteCollection.Url" -foregroundcolor red } }
The list of SharePoint sites that have ShortPoint installed will run similarly to the Results section of this article.
Related articles: