M365: Delete OneDrive Data After 30 Days

For once, a company has asked me to delete all OneDrive data for its users if the data is older than 30 days.

Go to Microsoft Purview (https://compliance.microsoft.com/) to set up a deletion policy. Once in Purview, I select the following menu option:

Data lifecycle management puis Retention Policy.

Then I created a new retention strategy

Then I decide to select the “static” option, as shown on the next screen

Since I plan to test this on my account and only on my OneDrive, I’m selecting the following option

Now I’m being asked to select users. Actually, you can still try—it seems you don’t need to enter user accounts, but rather URLs.

You might say that it’s not very obvious, but that’s actually what you need to do. To try to move forward, I copied the URL for my OneDrive and pasted it into the search field.

I then selected the URL in question. Next, I selected the following options:

I then reviewed the settings, as shown in the following screen

And then… an error message

The key is figuring out which URL to target.

To do this, you need to retrieve the correct URL by following these instructions: https://learn.microsoft.com/en-us/sharepoint/list-onedrive-urls. Then the strategy can be validated.

Best regards

Leave a Reply