The following script allow you to enable and configure RMS service in Office 365 and enable the IRM option for Exchange Online.

In order to activate IRM for Exchange Online or Sharepoint Online, you need to enable a configuration at Office 365.
The process to enable RMS in Office 365 is simple and it can be done in just a few minutes and the entire process can be configured with PowerShel.