Nov 13 2019 07:35 AM
I know you can create a One Drive retention policy against individual personal URLs, but I was wondering if there is anyway to automate this via an AD group or a specific AD attribute.
Basically we have a department that needs a specific retention policy set and I would like to see if we can automate adding them into the retention policy rather than having this as a manual process.
We sync our on-prem AD with AADC.
Nov 13 2019 09:21 AM
SolutionSadly, even after years of us asking for simplifying the experience when it comes to stamping retention on ODFB sites, the controls in the portal still only accept URLs. But, you can do it easily via PowerShell.
Nov 13 2019 09:52 AM
Nov 13 2019 11:47 PM
There are multiple samples online that you can use to enumerate ODFB drives, or filter them by some criteria. The simplest ones are listed here: https://docs.microsoft.com/en-us/onedrive/list-onedrive-urls
If you need a more robust method, you can use CSOM or the Graph API
Nov 14 2019 12:00 AM