Use PowerShell to Access a SharePoint Online Subsite List
Question details
Access a SharePoint Online list located on a subsite with PowerShell.

- 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.
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.
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.
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.
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.
Run Get-PnPList -Identity "List Name", replacing List Name with the list's title. To retrieve items, run Get-PnPListItem -List "List Name".
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.

Use the SharePoint Client Object Model for the Subsite
Use the SharePoint client object model if your existing script already relies on client-side SharePoint operations.
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.

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.




