Others

Use PowerShell to Access a SharePoint Online Subsite List

Khadija KhanKhadija Khan Nov 14, 2026 868 views

Question details

Access a SharePoint Online list located on a subsite with PowerShell.

Use PowerShell to Access a SharePoint Online Subsite List
Product
SharePoint Online
Device & OS
not provided
Scenario
A PowerShell script needs to work with a list on a subsite rather than at the site-collection level.
Observed behavior
Get-SPOSite rejects the subsite URL as an invalid managed path.
Before you start

Identify the site-collection URL, the full subsite URL, and the list name. Confirm that your account has access to the list and that you have an Entra ID application configured for PnP PowerShell interactive sign-in.

Solution 1Recommended

Connect to the Subsite with PnP PowerShell

Use PnP PowerShell to connect directly to the subsite and retrieve its list.

Get-SPOSite retrieves site collections, not individual subsites. Use the site-collection URL with Get-SPOSite and a subsite-aware tool for the list.

1
Install PnP PowerShell

Open a compatible PowerShell session and run Install-Module PnP.PowerShell -Scope CurrentUser. If the module is already installed, import it with Import-Module PnP.PowerShell.

2
Connect to the subsite

Run Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/collection/subsite" -Interactive -ClientId "<application-client-id>". Replace the URL and client ID with your subsite URL and registered application's client ID, then complete sign-in.

3
Retrieve the list

Run Get-PnPList -Identity "List Name", replacing List Name with the list's title. To retrieve items, run Get-PnPListItem -List "List Name".

4
Update the script

Replace the Get-SPOSite call that uses the subsite URL with the PnP connection and list commands. Keep any Get-SPOSite call pointed at the site-collection URL.

Connect to the Subsite with PnP PowerShell
Authentication and permissions: The registered application must support interactive authentication and have the necessary permissions and consent. Your signed-in account must also be authorized to access the subsite and list.
Free Microsoft Office alternative

Review Exported SharePoint List Data in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with exported list data and Office files. It does not fix SharePoint authentication or PowerShell commands, but it can help you continue working with compatible files.

Open CSV exports of SharePoint list data in WPS Spreadsheets.Work with Microsoft Excel XLSX, Word DOCX, and PowerPoint PPTX formats.Use a familiar interface for an easier move from Microsoft Office.Edit documents and spreadsheets with a free, lightweight office suite.
QA img-9

Frequently Asked Questions

Why does Get-SPOSite reject my subsite URL?

Get-SPOSite is intended for site collections rather than individual subsites. Use the site-collection URL with Get-SPOSite, and connect to the subsite with a tool such as PnP PowerShell.

How do I get items from a list on a subsite?

Connect with Connect-PnPOnline using the full subsite URL, then run Get-PnPListItem -List "List Name" with the actual list title.

What do I need for PnP PowerShell interactive sign-in?

You need a registered Entra ID application configured for interactive authentication, its client ID, the required permissions and consent, and an account with access to the list.

Can I open SharePoint list data in WPS Spreadsheets?

Yes. Export the list data to a CSV file using a suitable SharePoint or PowerShell method, then open the CSV file in WPS Spreadsheets. WPS does not resolve the SharePoint connection error.