Why Is My OneDrive URL Not Recognized in Set-RetentionCompliancePolicy?

0
45
Asked By CuriousCat92 On

Hey everyone! I'm facing a bit of a puzzle with PowerShell. I'm trying to run a cmdlet to add a OneDrive URL to the exclusion list of a retention policy, but even though the URL works perfectly when I open it or add it manually through the GUI, it's throwing an error. The error says it's not a valid SharePoint location. Has anyone else run into this issue? Here's the command I'm using:

```
Connect-IPPSSession
Set-RetentionCompliancePolicy -Identity "MyPolicy" -RemoveOneDriveLocation "https://-my.sharepoint.com/:x:/r/personal/"
```

I would really appreciate any insights!

2 Answers

Answered By TechieTom78 On

Make sure your OneDrive URL is formatted correctly. It should look like this: `https://contoso-my.sharepoint.com/personal/user_contoso_onmicrosoft_com/`. Replace "contoso" with your tenant name and "user" with the user's actual SAMAccountName. Also, check this article for more details: [OneDrive URLs](https://learn.microsoft.com/en-us/sharepoint/list-onedrive-urls). Good luck!

HelpfulHank24 -

I tried the correct URL format but still got the same error message. Any thoughts on what might be wrong?

Answered By CloudGuru43 On

That error often means you may be using the wrong type of URL. What you have looks more like a sharing or mapped path rather than a direct OneDrive path. Make sure you're using the actual OneDrive URL, not the shared link.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.