Showing results for 
Search instead for 
Did you mean: 

Using Microsoft Flow in combination with IRM & Sharepoint to address DLP scenarios



  • Customer leverages legacy BI/Visualization/Reporting tool to share key insights with the their leadership team over email. 
  • "PDF” is the chosen format and into which the team has invested considerable time and effort.
  • Automated using business logic built "over-the-years" and not so agile tool, making changes at the source level is a No-GO. 
  • Includes scenarios across:-
    • Single user + Single attachment
    • Multiple users + Single attachment
    • Multiple Users + Multiple attachments




  • Data was getting leaked with the PDFs/excerpts getting shared outside the organization.
  • No central repository of these reports for auditing / e-discovery


Tech Challenge


  • A simplistic way to ensure that all attachments (PDF) in the email originating from the legacy reporting publishing engine were encrypted.
  • We could have leveraged office365 Message Encryption, but we do not yet protect a PDF embedded as an attachment.
  • Un-willingness/In-ability to leverage Word / Excel based templates over PDF.  



  • Microsoft Flow.
  • A high-level flow is as below:-
    • Legacy system generates the email AS-IS the current process.
    • Transport Rule on Exchange Online intercepts the email and “Redirects” it to the generic Mailbox.
    • Microsoft Flow is triggered on the arrival of a new email into their generic Mailbox.
    • It creates a copy of these attachments onto the IRM enabled document library within SharePoint Online.
    • Fetches the attachments into an Array @ runtime
    • Composes and sends out the email to the intended recipients.  
    • NOTE: from an end-user POV, nothing changes, except that the attachment is now encrypted and accessible ONLY via the Azure Information Protection viewer and subject to all IRM policies.  

 Key references


Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.