The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi @john john Pter,
Try executing two commands separately:
Set-SPOSite -Identity https://*.sharepoint.com -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 15 -MajorwithMinorVersionsLimit 10 -ExpireVersionsAfterDays 300 -ApplyToNewDocumentLibraries
and
Set-SPOSite -Identity https://*.sharepoint.com -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 15 -MajorwithMinorVersionsLimit 10 -ExpireVersionsAfterDays 300 -ApplyToExistingDocumentLibraries
Changes might take time to apply. New libraries created immediately after the command might not reflect updates.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.