Skip to content

spo folder list

Returns all folders under the specified parent folder


m365 spo folder list [options]


-u, --webUrl <webUrl>
The URL of the site where the folders to list are located
-p, --parentFolderUrl <parentFolderUrl>
Site-relative URL of the parent folder
-r, --recursive
Set to retrieve nested folders
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.
--query [query]
JMESPath query string. See for more information and examples
-o, --output [output]
Output type. json,text,csv,md. Default json
Runs command with verbose logging
Runs command with debug logging


Gets list of folders under a parent folder with site-relative url /Shared Documents located in site

m365 spo folder list --webUrl --parentFolderUrl '/Shared Documents'

Gets recursive list of folders under a specific folder on a specific site

m365 spo folder list --webUrl --parentFolderUrl '/Shared Documents' --recursive


    "Exists": true,
    "IsWOPIEnabled": false,
    "ItemCount": 9,
    "Name": "Folder A",
    "ProgID": null,
    "ServerRelativeUrl": "/Shared Documents/Folder A",
    "TimeCreated": "2022-04-26T12:30:56Z",
    "TimeLastModified": "2022-04-26T12:50:14Z",
    "UniqueId": "20523746-971b-4488-aa6d-b45d645f61c5",
    "WelcomePage": ""
Name     ServerRelativeUrl
-------  -------------------------
Folder A /Shared Documents/Folder A
Folder A,/Shared Documents/Folder A