spo site versionpolicy get
Retrieves the version policy settings of a specific site.
Usage
m365 spo site versionpolicy get [options]
Options
-u, --siteUrl <siteUrl>URL of the site.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Permissions
- Delegated
- Application
| Resource | Permissions |
|---|---|
| SharePoint | AllSites.Read |
| Resource | Permissions |
|---|---|
| SharePoint | Sites.Read.All |
Examples
Retrieve the version policy settings of a specific site.
m365 spo site versionpolicy get --siteUrl "https://contoso.sharepoint.com/sites/Marketing"
Response
- JSON
- Text
- CSV
- Markdown
{
"defaultTrimMode": "automatic",
"defaultExpireAfterDays": 30,
"majorVersionLimit": 500
}
defaultExpireAfterDays: 30
defaultTrimMode : automatic
majorVersionLimit : 500
defaultTrimMode,defaultExpireAfterDays,majorVersionLimit
automatic,30,500
# spo site versionpolicy get --debug "false" --verbose "false" --siteUrl "https://contoso.sharepoint.com/"
Date: 8/23/2025
Property | Value
---------|-------
defaultTrimMode | automatic
defaultExpireAfterDays | 30
majorVersionLimit | 500