Forum Discussion
M365/ SharePoint Online Archive - Redirect URL
MichaelStephens1655 First off, you're spot on about the ArchiveRedirectURL parameter being unavailable in the current SharePoint Online Management Shell module. This archive redirect functionality for sites is still in preview, so PowerShell support may be limited for now. As for the LockState, you're correct that 'Archive' should be the appropriate value when archiving a site collection. The other valid options are Unlocked, NoAccess, and ReadOnly. However, since that ArchiveRedirectURL parameter seems inaccessible via PowerShell currently, we'll need to explore alternatives. One potential avenue could be leveraging the Microsoft Graph API directly or through an SDK, as it exposes the 'archiveRedirectUrl' property when archiving sites.
Alternatively, you could consider raising a support case with Microsoft. Their team may provide insights into the current status and any available workarounds for setting the custom archive URL redirect through PowerShell or other methods. In the interim, a possible workaround, albeit not ideal, might involve using the NoAccessRedirectURL parameter instead. This would redirect all access-denied requests, including archived sites, to the specified URL. Though, as you mentioned, it may not be the most suitable solution if you need a more targeted redirect for archived sites specifically.
Here's an example of how you could set that NoAccessRedirectURL using PowerShell as a temporary measure:
# Connect to SharePoint Online
Connect-SPOService -Url https://yourTenant.sharepoint.com
# Set NoAccessRedirectURL for all site collections
Get-SPOSite | ForEach-Object {
Set-SPOSite -Identity $_.Url -NoAccessRedirectUrl "https://your-archive-redirect-url"
}
# Disconnect from SharePoint Online
Disconnect-SPOService
Moving forward, as the Archive functionality evolves from preview, more options and PowerShell support may become available. Keeping tabs on official documentation and maintaining an open support case could unveil more tailored solutions aligning with your requirements.