When creating custom solutions or even troubleshooting your data lifecycle management processes, you may need to know the retention label’s underlying GUID (Globally Unique Identifier).  This is the ID created for the retention label that Microsoft Purview uses for its back-end processes.  Unfortunately, there isn’t an easy way to find this ID from the Purview user interface.  To find the ID, a PowerShell command will need to be run; I’ll cover that process in this post.

Get a Retention Label’s GUID with PowerShell

Since you can’t get the GUID from the Microsoft Purview web interface; we’re going to need PowerShell for this one.  In my tenant, I have a label called Transitory Content.  I wanted to create a process to support the disposition by location process in my tenant, I need to know the internal ID of the label so the Power Automate flow can find it in the cross reference list.  After opening the PowerShell window, we need to log in to the Security and Compliance PowerShell Cmdlet via the Exchange PowerShell Module.

  1. You may need to import the Exchange Online module first, but running:
Import-Module ExchangeOnlineManagement
  1. Once the module is imported, connect to Exchange Online:
Connect-IPPSSession -UserPrincipalName ddrever@<tenant domain>
  1. By default, the system will log in via an interactive log-on via your browser.

Get a Retention Label's GUID - PowerShell Login

Once logged in, use the Get-ComplianceTag cmdlet to gather the necessary information.  The ID is stored in several properties within the retention label.  The ID can be accessed via the ImmutableID, GUID, or the ExchangeObjectID

Get-ComplianceTag -Identity "Transitory Content" | Select ImmutableID, GUID, ExchangeObjectID | Format-List

Get a Retention Label's GUID - Get-ComplianceTag

You can now use the ID for whichever requirement you have.

Thanks for reading!