Check out the great work by Will Gries in this blog post.
Here's a brief excerpt ...
File Classification Infrastructure (FCI) is a built-in feature on Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 that helps IT admins to manage their organization's data on file servers by providing automatic classification processes. Using rules which are constructed with regular expressions, PowerShell, and/or .NET or native modules, FCI can identify sensitive files and perform actions such as encrypting Microsoft Office documents with Rights Management Services (RMS), expiring files that have passed a defined date limit, or other custom action (defined through a script/program).
A recent update has added a section about enabling the script to work with Azure RMS in addition to RMS on-prem.
on behalf of Dan Plastina and the RMS Team