Sensitivity labels in Powershell: DetailedLabelActions
Intro
This article completes a broader and more general article talking about sensitivity labels in Powershell
Prerequisites
Make sure you install Exchange Online module and Connect to Security & Compliance Center PowerShell in your Microsoft 365 tenant.
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.5
Connect-IPPSSession -UserPrincipalName User@contoso.com
Get All Details on a Label
Cmdlet
Get-Label -Identity "MyTestLabel"
Results
RunspaceId : 5a60e051-2335-46d7-89bc-cedd030b1213
Settings : {[isparent, False], [contenttype, File, Email], [tooltip, KeywordLabel 2],
[displayname, KeywordLabel 2]}
LabelActions : {}
Conditions : {}
ColumnAssetCondition :
SchematizedDataCondition :
LocaleSettings : {{"LocaleKey":"displayName","Settings":[{"Key":"default","Value":"KeywordLabel
2"}]}, {"LocaleKey":"tooltip","Settings":[{"Key":"default","Value":"KeywordLabel
2"}]}}
DisplayName : KeywordLabel 2
ParentId :
AbacEnabled :
CustomSecurityAttributeRequired :
IsParent : False
Tooltip : KeywordLabel 2
DefaultContentLabel :
ContentType : File, Email
Capabilities : {}
ParentLabelDisplayName :
ReadOnly : False
ExternalIdentity :
ImmutableId : 51c2714c-4c2a-441d-bd74-d6a2ccf24d96
Priority : 1
Workload : Exchange, SharePoint
Policy : 2457b8f0-a4b5-466f-bf20-f6e67f2185a9
Comment :
Disabled : False
Mode : Enforce
ObjectVersion : 223e340a-a4e6-414c-06d8-08da172d9ff1
CreatedBy : Acco Noal
LastModifiedBy : Acco Noal
Guid : 51c2714c-4c2a-441d-bd74-d6a2ccf24d96
Identity : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/KeywordLabel 2
Id : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/KeywordLabel 2
IsValid : True
ExchangeVersion : 0.20 (15.0.0.0)
Name : KeywordLabel 2
DistinguishedName : CN=KeywordLabel 2,CN=Configuration,CN=AccoNoal.onmicrosoft.com,OU=Microsoft Exchange
Hosted Organizations,DC=FFO,DC=extest,DC=microsoft,DC=com
ObjectCategory :
ObjectClass : {msExchUnifiedRule}
WhenChanged : 4/5/2022 7:56:35 PM
WhenCreated : 4/5/2022 7:56:35 PM
WhenChangedUTC : 4/5/2022 5:56:35 PM
WhenCreatedUTC : 4/5/2022 5:56:35 PM
ExchangeObjectId : 51c2714c-4c2a-441d-bd74-d6a2ccf24d96
OrganizationalUnitRoot : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com
OrganizationId : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com - FFO.extest.microsoft.com/Microsoft Exchange
Hosted Organizations/AccoNoal.onmicrosoft.com/Configuration
OriginatingServer :
ObjectState : New
See Label Actions
Cmdlet
get-label -Identity "Keyword-Label" -IncludeDetailedLabelActions $true |fl
Results
-- EXAMPLE 1 --
RunspaceId : 5a60e051-2335-46d7-89bc-cedd030b1213
LabelActionParsingFailures : {}
ApplyContentMarkingFooterAlignment :
ApplyContentMarkingFooterEnabled :
ApplyContentMarkingFooterFontColor :
ApplyContentMarkingFooterFontName :
ApplyContentMarkingFooterFontSize :
ApplyContentMarkingFooterMargin :
ApplyContentMarkingFooterPlacement :
ApplyContentMarkingFooterText :
ApplyContentMarkingHeaderAlignment :
ApplyContentMarkingHeaderEnabled :
ApplyContentMarkingHeaderFontColor :
ApplyContentMarkingHeaderFontName :
ApplyContentMarkingHeaderFontSize :
ApplyContentMarkingHeaderMargin :
ApplyContentMarkingHeaderPlacement :
ApplyContentMarkingHeaderText :
ApplyWaterMarkingEnabled :
ApplyWaterMarkingFontColor :
ApplyWaterMarkingFontName :
ApplyWaterMarkingFontSize :
ApplyWaterMarkingLayout :
ApplyWaterMarkingText :
EncryptionAipTemplateScopes :
EncryptionContentExpiredOnDateInDaysOrNever : Never
EncryptionDoNotForward :
EncryptionDoubleKeyEncryptionUrl :
EncryptionEnabled : True
EncryptionEncryptOnly :
EncryptionLinkedTemplateId : 1d44019e-a719-4ec7-a25d-7e20d88e9c2b
EncryptionOfflineAccessDays : 0
EncryptionPromptUser :
EncryptionProtectionType : Template
EncryptionRightsDefinitions : [{"Identity":"AccoNoal@AccoNoal.onmicrosoft.com","Rights":"VIEW,VIEWRI
GHTSDATA,DOCEDIT,EDIT,PRINT,EXTRACT,REPLY,REPLYALL,FORWARD,OBJMODEL"}]
EncryptionRightsUrl :
EncryptionTemplateArchived : False
EncryptionTemplateId : 1d44019e-a719-4ec7-a25d-7e20d88e9c2b
SiteAndGroupProtectionAllowAccessToGuestUsers :
SiteAndGroupProtectionAllowEmailFromGuestUsers :
SiteAndGroupProtectionAllowFullAccess :
SiteAndGroupProtectionAllowLimitedAccess :
SiteAndGroupProtectionBlockAccess :
SiteExternalSharingControlType :
SiteAndGroupProtectionLevel :
SiteAndGroupProtectionEnabled :
SiteAndGroupProtectionPrivacy :
TeamsProtectionEnabled :
TeamsLobbyRestrictionEnforced :
TeamsBypassLobbyForDialInUsers :
TeamsLobbyBypassScope :
TeamsPresentersRestrictionEnforced :
TeamsAllowedPresenters :
TeamsCopyRestrictionEnforced :
Settings : {[isparent, False], [contenttype, File, Email], [tooltip, keyword
label], [displayname, Keyword-Label]}
LabelActions : {{"Type":"encrypt","SubType":null,"Settings":[{"Key":"protectiontype",
"Value":"template"},{"Key":"disabled","Value":"false"},{"Key":"templat
eid","Value":"1d44019e-a719-4ec7-a25d-7e20d88e9c2b"},{"Key":"templatea
rchived","Value":"False"},{"Key":"linkedtemplateid","Value":"1d44019e-
a719-4ec7-a25d-7e20d88e9c2b"},{"Key":"contentexpiredondateindaysorneve
r","Value":"Never"},{"Key":"offlineaccessdays","Value":"0"},{"Key":"ri
ghtsdefinitions","Value":"[{\"Identity\":\"AccoNoal@AccoNoal.onmicroso
ft.com\",\"Rights\":\"VIEW,VIEWRIGHTSDATA,DOCEDIT,EDIT,PRINT,EXTRACT,R
EPLY,REPLYALL,FORWARD,OBJMODEL\"}]"}]}}
Conditions : {{"And":[{"And":[{"Key":"CCSI","Value":"cb353f78-2b72-4c3c-8827-92ebe4
f69fdf","Properties":null,"Settings":[{"Key":"mincount","Value":"1"},{
"Key":"maxconfidence","Value":"100"},{"Key":"groupname","Value":"Defau
lt"},{"Key":"rulepackage","Value":"00000000-0000-0000-0000-00000000000
0"},{"Key":"name","Value":"ABA Routing Number"},{"Key":"minconfidence"
,"Value":"75"},{"Key":"policytip","Value":"Bravo! You applied a label"
},{"Key":"classifiertype","Value":"Content"},{"Key":"confidencelevel",
"Value":"Medium"},{"Key":"autoapplytype","Value":"Recommend"}]}]}]}}
ColumnAssetCondition :
SchematizedDataCondition :
LocaleSettings : {{"LocaleKey":"displayName","Settings":[{"Key":"default","Value":"Keyw
ord-Label"}]},
{"LocaleKey":"tooltip","Settings":[{"Key":"default","Value":"keyword
label"}]}, {"LocaleKey":"autotooltip","Settings":[{"Key":"default","Va
lue":"Bravo! You applied a label"}]}}
DisplayName : Keyword-Label
ParentId :
AbacEnabled :
CustomSecurityAttributeRequired :
IsParent : False
Tooltip : keyword label
DefaultContentLabel :
ContentType : File, Email
Capabilities : {AutoLabel}
ParentLabelDisplayName :
ReadOnly : False
ExternalIdentity :
ImmutableId : 54518ca3-05bb-4784-9845-d8e407057b83
Priority : 0
Workload : Exchange, SharePoint
Policy : 2457b8f0-a4b5-466f-bf20-f6e67f2185a9
Comment :
Disabled : False
Mode : Enforce
ObjectVersion : 033d971a-e37f-4d30-c275-08da1727a8b7
CreatedBy : Acco Noal
LastModifiedBy : Acco Noal
Guid : 54518ca3-05bb-4784-9845-d8e407057b83
Identity : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/Keyword-Label
Id : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/Keyword-Label
IsValid : True
ExchangeVersion : 0.20 (15.0.0.0)
Name : Keyword-Label
DistinguishedName : CN=Keyword-Label,CN=Configuration,CN=AccoNoal.onmicrosoft.com,OU=Micro
soft Exchange Hosted
Organizations,DC=FFO,DC=extest,DC=microsoft,DC=com
ObjectCategory :
ObjectClass : {msExchUnifiedRule}
WhenChanged : 4/6/2022 2:48:14 AM
WhenCreated : 4/5/2022 7:13:52 PM
WhenChangedUTC : 4/6/2022 12:48:14 AM
WhenCreatedUTC : 4/5/2022 5:13:52 PM
ExchangeObjectId : 54518ca3-05bb-4784-9845-d8e407057b83
OrganizationalUnitRoot : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com
OrganizationId : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com -
FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration
OriginatingServer :
ObjectState : Unchanged
-- EXAMPLE 2 --
RunspaceId : 5a60e051-2335-46d7-89bc-cedd030b1213
LabelActionParsingFailures : {}
ApplyContentMarkingFooterAlignment : Right
ApplyContentMarkingFooterEnabled :
ApplyContentMarkingFooterFontColor : #0000FF
ApplyContentMarkingFooterFontName :
ApplyContentMarkingFooterFontSize : 40
ApplyContentMarkingFooterMargin : 5
ApplyContentMarkingFooterPlacement : Footer
ApplyContentMarkingFooterText : Company Name
ApplyContentMarkingHeaderAlignment : Left
ApplyContentMarkingHeaderEnabled :
ApplyContentMarkingHeaderFontColor : #008000
ApplyContentMarkingHeaderFontName :
ApplyContentMarkingHeaderFontSize : 18
ApplyContentMarkingHeaderMargin : 5
ApplyContentMarkingHeaderPlacement : Header
ApplyContentMarkingHeaderText : Company Name
ApplyWaterMarkingEnabled :
ApplyWaterMarkingFontColor : #FFFF00
ApplyWaterMarkingFontName :
ApplyWaterMarkingFontSize : 14
ApplyWaterMarkingLayout : Diagonal
ApplyWaterMarkingText : Blaaaaa
EncryptionAipTemplateScopes :
EncryptionContentExpiredOnDateInDaysOrNever :
EncryptionDoNotForward :
EncryptionDoubleKeyEncryptionUrl :
EncryptionEnabled :
EncryptionEncryptOnly :
EncryptionLinkedTemplateId :
EncryptionOfflineAccessDays :
EncryptionPromptUser :
EncryptionProtectionType :
EncryptionRightsDefinitions :
EncryptionRightsUrl :
EncryptionTemplateArchived :
EncryptionTemplateId :
SiteAndGroupProtectionAllowAccessToGuestUsers :
SiteAndGroupProtectionAllowEmailFromGuestUsers :
SiteAndGroupProtectionAllowFullAccess :
SiteAndGroupProtectionAllowLimitedAccess :
SiteAndGroupProtectionBlockAccess :
SiteExternalSharingControlType :
SiteAndGroupProtectionLevel :
SiteAndGroupProtectionEnabled :
SiteAndGroupProtectionPrivacy :
TeamsProtectionEnabled :
TeamsLobbyRestrictionEnforced :
TeamsBypassLobbyForDialInUsers :
TeamsLobbyBypassScope :
TeamsPresentersRestrictionEnforced :
TeamsAllowedPresenters :
TeamsCopyRestrictionEnforced :
Settings : {[isparent, False], [contenttype, File, Email], [tooltip,
Watermark2], [displayname, Watermark2]}
LabelActions : {{"Type":"applycontentmarking","SubType":"header","Settings":[{"Key":"
text","Value":"Company Name"},{"Key":"fontsize","Value":"18"},{"Key":"
fontcolor","Value":"#008000"},{"Key":"alignment","Value":"Left"},{"Key
":"margin","Value":"5"},{"Key":"placement","Value":"Header"}]}, {"Type
":"applycontentmarking","SubType":"footer","Settings":[{"Key":"text","
Value":"Company Name"},{"Key":"fontsize","Value":"40"},{"Key":"fontcol
or","Value":"#0000FF"},{"Key":"alignment","Value":"Right"},{"Key":"mar
gin","Value":"5"},{"Key":"placement","Value":"Footer"}]}, {"Type":"app
lywatermarking","SubType":null,"Settings":[{"Key":"text","Value":"Blaa
aaa"},{"Key":"fontsize","Value":"14"},{"Key":"fontcolor","Value":"#FFF
F00"},{"Key":"layout","Value":"Diagonal"}]}}
Conditions : {}
ColumnAssetCondition :
SchematizedDataCondition :
LocaleSettings : {{"LocaleKey":"displayName","Settings":[{"Key":"default","Value":"Wate
rmark2"}]}, {"LocaleKey":"tooltip","Settings":[{"Key":"default","Value
":"Watermark2"}]}}
DisplayName : Watermark2
ParentId :
AbacEnabled :
CustomSecurityAttributeRequired :
IsParent : False
Tooltip : Watermark2
DefaultContentLabel :
ContentType : File, Email
Capabilities : {}
ParentLabelDisplayName :
ReadOnly : False
ExternalIdentity :
ImmutableId : 65299cc6-c316-41e7-87bf-1fcbc628affd
Priority : 4
Workload : Exchange, SharePoint
Policy : 2457b8f0-a4b5-466f-bf20-f6e67f2185a9
Comment :
Disabled : False
Mode : Enforce
ObjectVersion : ed7a800a-16a3-4f08-3dee-08da1982ae68
CreatedBy : Acco Noal
LastModifiedBy : Acco Noal
Guid : 65299cc6-c316-41e7-87bf-1fcbc628affd
Identity : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/Watermark2
Id : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration/Watermark2
IsValid : True
ExchangeVersion : 0.20 (15.0.0.0)
Name : Watermark2
DistinguishedName : CN=Watermark2,CN=Configuration,CN=AccoNoal.onmicrosoft.com,OU=Microsof
t Exchange Hosted Organizations,DC=FFO,DC=extest,DC=microsoft,DC=com
ObjectCategory :
ObjectClass : {msExchUnifiedRule}
WhenChanged : 4/8/2022 7:10:28 PM
WhenCreated : 4/8/2022 7:10:28 PM
WhenChangedUTC : 4/8/2022 5:10:28 PM
WhenCreatedUTC : 4/8/2022 5:10:28 PM
ExchangeObjectId : 65299cc6-c316-41e7-87bf-1fcbc628affd
OrganizationalUnitRoot : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com
OrganizationId : FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com -
FFO.extest.microsoft.com/Microsoft Exchange Hosted
Organizations/AccoNoal.onmicrosoft.com/Configuration
OriginatingServer :
ObjectState : New
See Also
Sensitivity labels in Powershell
Audit your sensitivity labels with Powershell