The script is available for download from https://gallery.technet.microsoft.com//Search-for-Email-Messages-b56979d0. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This script searches for email messages that have a retention tag in Office 365 Exchange Online. This script returns email messages from multiple mailbox folders by default. You can use retention period rather than retention tag name to search.
Currently, you can easily search email messages that have a retention tag in Outlook. But you will find that this feature is not available in Outlook Web App (OWA). You want to find a workaround for those people who use Outlook Web App only.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery