Using Adaptive Policy Scopes to Apply M365 Retention to Shared, Resource, and Inactive Mailboxes

Published Jan 11 2022 10:49 AM 4,667 Views
Microsoft

Update (2022-02-08:) This blog has been updated to include recent changes in the feature.

 

Back in October 2021 we announced the public preview of an exciting new Microsoft Information Governance and Records Management feature called adaptive policy scopes. This feature provides advanced flexibility when applying retention policies and labels to user, site, and group locations in Microsoft 365.

 

Many organizations have regulatory, legal, or business requirements that demand different retention rules to apply to various departments, locations, and roles. Adaptive policy scopes help to provide the flexibility needed to achieve these requirements by allowing administrators to scope policies based on common attributes and properties from Azure AD (including those synced from on-premises AD in hybrid environments) or indexed properties from SharePoint Online sites.

 

However, there are also certain scenarios in which an organization may want to include or exclude locations from a policy based on more granular attributes such as the type or state of an object. This is particularly true in Exchange Online as several different types of mailboxes exist.  The most common types of mailboxes are user mailboxes and Microsoft 365 group mailboxes (which are used by Microsoft 365 Modern Groups and Microsoft Teams).  These mailbox types are easily targeted using adaptive policy scopes with user and group scopes, respectively.   

 

But there are several other types and states of mailboxes that organizations commonly use.  These can include shared mailboxes, resource mailboxes, and inactive mailboxes.  This blog post will review how an administrator can create scopes that include or exclude these other common types of mailboxes for maximum flexibility in applying Microsoft 365 retention policies and labels.

 

Shared mailbox retention with adaptive policy scopes

 

When adaptive policy scopes were in private preview one of the most common requests we received was to support shared mailboxes.  Shared mailboxes are used by organizations when multiple users need to access a single mailbox such as a support, receptionist, or department mailbox.  Unfortunately, although they were included in organization-wide retention policies using static scopes, we were unable to add shared mailbox support to adaptive policy scopes before it went to public preview.  We are excited to announce that support for shared mailboxes in adaptive policy scopes has recently been fully rolled out and you can now create scopes to target them in your tenant today.

 

Shared mailboxes share many similar attributes with user mailboxes.  There are several ways that you could effectively target them in adaptive policy scopes, such as using department, location, or even some custom identifiable information specified with CustomAttributes1-15. 

 

For example, let’s say you want to target all mailboxes that are in the legal department and have retention requirements.  You can use the department attribute and utilize one of the custom attributes to identify mailboxes that should be included in the scope, which are all available options in the simple query builder for adaptive policy scopes:

 

The simple query builder can be used to target different mailbox types using custom attributes.The simple query builder can be used to target different mailbox types using custom attributes.

 

NOTE: If your organization synchronizes its on-premises directory with Azure AD, for synced objects you will need to configure most attributes on-premises and then synchronize any changes with Azure AD before querying them in adaptive policy scopes.

 

But, what if you want to include or exclude a shared mailbox in an adaptive policy scope based solely on the mailbox type?  This is where the advanced query builder can be very useful.

 

The advanced query builder is an alternate configuration option for the adaptive policy scopes wizard.  With user scopes (which target the types of mailboxes we are discussing in this blog), it uses OPATH to query objects.  You can access the advanced query builder by clicking the blue button at the top of the simple query builder screen:

 

The advanced query builder can be accessed using the button in the top right of the simple query builder.The advanced query builder can be accessed using the button in the top right of the simple query builder.

 

With OPATH and the advanced query builder, you can use the RecipientTypeDetails property of the mailbox with the SharedMailbox type.  Exchange Online PowerShell can be used to test the OPATH query:

 

Update (2022-02-08): This article previously recommended using the IsShared property but since then RecipientTypeDetails has been supported.  RecipientTypeDetails is a better choice for shared mailboxes as it excludes certain system mailboxes such as discovery search mailboxes.

 

Get-Mailbox -Filter {RecipientTypeDetails -eq "SharedMailbox"}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
TestSharedMailbox20211... testsharedma... NAMPR13DG031-db016             99 GB (106,300,44...
TestSharedMailbox22022... testsharedma... NAMPR13DG091-db016             99 GB (106,300,44...

 

Then, simply input the OPATH query into the advanced query builder within the adaptive policy scope wizard:

 

The advanced query builder can use OPATH to filter SharedMailboxes using RecipientTypeDetailsThe advanced query builder can use OPATH to filter SharedMailboxes using RecipientTypeDetails

 

NOTE: For more examples of using OPATH and the advanced query builder, check out our recent webinar Building Advanced Queries for Users and Groups with Adaptive Policy Scopes.

 

Resource mailbox retention using adaptive policy scopes

 

Like shared mailboxes, resource mailboxes were also not available for use in adaptive policy scopes at the launch of the public preview, but now are available to use in your tenant today.  Resource mailboxes are used to help manage physical resources in Exchange Online.  There are two different types of resource mailboxes:

  • Room mailbox is a resource mailbox that is assigned to a physical location, such as a conference room.
  • Equipment mailbox is a mailbox assigned to a resource that is not location-specific, such as a projector.

 

Unlike shared mailboxes, however, resource mailboxes historically have never been included in Microsoft 365 retention policies.  Now, with adaptive policy scopes, you can create policies specifically for your organization’s room and equipment mailboxes (such as a policy to delete items after 1 year) or include them in your organization's existing retention policies.

 

Since resource mailboxes are very similar to shared mailboxes, most of the options an administrator has for filterable properties are the same.  For filtering by mailbox type using OPATH and the advanced query builder, you can again use the property RecipientTypeDetails with RoomMailbox or EquipmentMailbox types:

 

Update (2022-02-08): This article previously recommended using the IsResource property but since then RecipientTypeDetails has been supported.  RecipientTypeDetails is a better choice for resource mailboxes as allows you to distinguish between room and equipment mailboxes.

 

 

OPATH in Exchange Online PowerShell

 

Get-Mailbox -Filter {RecipientTypeDetails -eq "RoomMailbox"}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
testRoomMailbox           testRoomMailbox namPR13DG304-db141             99 GB (106,300,44...


Get-Mailbox -Filter {RecipientTypeDetails -eq "EquipmentMailbox"}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
testEquipmentMailbox      testEquipmen... NAMPR13DG086-db021             99 GB (106,300,44...


Get-Mailbox -Filter {RecipientTypeDetails -eq "RoomMailbox" -or RecipientTypeDetails -eq "EquipmentMailbox"}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
testRoomMailbox           testRoomMailbox namPR13DG304-db141             99 GB (106,300,44...
testEquipmentMailbox      testEquipmen... NAMPR13DG086-db021             99 GB (106,300,44...

 

OPATH in the advanced query builder - including both room and equipment mailboxes

 

The advanced query builder can use OPATH to filter room or equipment mailboxes using RecipientTypeDetailsThe advanced query builder can use OPATH to filter room or equipment mailboxes using RecipientTypeDetails

 

Inactive mailbox retention using adaptive policy scopes

 

Unlike shared and resource mailboxes, inactive mailboxes have been supported with adaptive policy scopes since the public preview release.  Inactive mailboxes are not a mailbox type; they are instead a mailbox state. 

 

When a user object is deleted from Azure AD (such as when an employee leaves the organization), the Microsoft 365 license once again becomes available.  But, if the associated mailbox has a legal or regulatory hold applied to it, we cannot delete the mailbox so, instead, it becomes inactive.

 

Before adaptive policy scopes, retention policies that applied to the entire organization (org-wide) for the Exchange location would automatically affect inactive mailboxes. However, there was no efficient way to have a retention policy specific to inactive mailboxes until now.  For example, an organization may choose to keep inactive mailbox data for 1 year after an employee leaves but keep the data of active employees for 5 years.

 

With adaptive policy scopes, you can target inactive mailboxes using the advanced query builder similarly to how you would for shared and resource mailboxes, but using the IsInactiveMailbox property:

 

OPATH in Exchange Online PowerShell

 

Get-Mailbox -IncludeInactiveMailbox -Filter {IsInactiveMailbox -eq "True"}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
inactivemailboxTest       inactivemail... NAMPR13DG282-db075             99 GB (106,300,44...

 

NOTE: You can also filter on other properties such as department, location, and custom attributes however once a mailbox is made inactive, those properties cannot be changed.

 

Applying a scope to multiple mailbox types

 

One of the major benefits of adaptive policy scopes is how powerful they can be.  Administrators can create extremely complex queries allowing virtually any requirement to be achievable.  As a more advanced example, the following scope applies to shared mailboxes, room mailboxes, but excludes all inactive mailboxes:

 

Update (2022-02-08): This article previously recommended using the IsShared and IsResource properties but since then RecipientTypeDetails has been supported.  RecipientTypeDetails is a better choice for shared and resource mailboxes as it excludes certain system mailboxes such as discovery search mailboxes and allows distinction between resource mailbox types.

 

OPATH in Exchange Online PowerShell

 

Get-Mailbox -Filter {((RecipientTypeDetails -eq "RoomMailbox") -or (RecipientTypeDetails -eq "SharedMailbox")) -and (IsInactiveMailbox -eq "False")}

Name                      Alias           Database                       ProhibitSendQuota
----                      -----           --------                       -----------------
TestSharedMailbox20211... testsharedma... NAMPR13DG031-db016             99 GB (106,300,44...
TestSharedMailbox22022... testsharedma... NAMPR13DG091-db016             99 GB (106,300,44...
testRoomMailbox           testRoomMailbox namPR13DG304-db141             99 GB (106,300,44...

 

OPATH in the advanced query builder

 

OPATH and the advanced query builder allow for complex but flexible scoping.OPATH and the advanced query builder allow for complex but flexible scoping.

 

Validating Advanced Queries

 

Update (2022-02-08) Previously, we never had  any validation for OPATH queries.  That meant if the query was incorrectly formatted you would only know after waiting several days for the scope the populate.  We've since released basic query validation for OPATH.  If an incorrect query is entered and the scope is saved/created, an error message will display:

 

OPATH queries are now validated before saving.OPATH queries are now validated before saving.

 

However, you may want to know which objects will match the query while building it.  To help understand what objects a query will return, we've created a script that can be used to validate OPATH queries for user and group scopes.

 

Also, as we previously stated, we hosted a recent webinar that discussed building advanced queries for user and group scopes.

 

The validation script allows testing results from an OPATH query.The validation script allows testing results from an OPATH query.The script will give a sample output and allow export if -ExportCSV is specified.The script will give a sample output and allow export if -ExportCSV is specified.

 

FAQ

 

What scope type should I use for shared, resource, or inactive mailboxes?

For shared, resource, and inactive mailboxes, you should use the “user” scope type as they all refer to user objects in Azure AD.

 

Do I need to use the advanced query builder and OPATH for shared, resource, and inactive mailboxes?

By default, all mailbox types are included in the scope.  So, if you don't need to exclude any of these mailbox types, you can use the simple query builder provided the properties needed are available.  If you do need to exclude one or more of these mailbox types or if the simple query builder doesn't have a property that you need to filter, you will need to use OPATH and the advanced query builder as RecipientTypeDetails, IsShared, IsResource, and IsInactiveMailbox properties are not currently available in the simple query builder.

 

What if I have already created scopes for my organization but didn’t take into consideration shared, resource or inactive mailboxes?

If your existing scope doesn’t already exclude the types of mailboxes you don’t want included you should consider modifying the scopes using the above properties.  If your existing scope uses a query built with the simple query builder, you will need to convert your query to OPATH and use the advanced query builder.

 

Do shared and resource mailboxes need to be licensed to use with adaptive policy scopes?

Yes, as with user mailboxes, shared and resource mailboxes need to have an applicable license applied for compliant usage with adaptive policy scopes.  As of the publish date of this blog these licenses include the following:

  • Microsoft 365 E5/A5/G5
  • Microsoft 365 E5/A5/G5 Compliance
  • Microsoft 365 E5/A5 Information Protection and Governance
  • Microsoft 365 F5 Compliance
  • Microsoft 365 F5 Security and Compliance
  • Office 365 E5/A5/G5

 

How do you appropriately license an inactive mailbox?

Inactive mailboxes must have the appropriate license assigned to the mailbox before making it inactive.  Once the mailbox is made inactive the license will be free to use elsewhere. For more information, see create an inactive mailbox.

2 Comments
%3CLINGO-SUB%20id%3D%22lingo-sub-3060303%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Adaptive%20Policy%20Scopes%20to%20Apply%20M365%20Retention%20to%20Shared%2C%20Resource%2C%20and%20Inactive%20Mailboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3060303%22%20slang%3D%22en-US%22%3E%3CP%3EThose%20are%20great%20additions%2C%20thank%20you!%20The%20licensing%20requirement%20is%20of%20course%20unfortunate%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3053641%22%20slang%3D%22en-US%22%3EUsing%20Adaptive%20Policy%20Scopes%20to%20Apply%20M365%20Retention%20to%20Shared%2C%20Resource%2C%20and%20Inactive%20Mailboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3053641%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3E%3CSTRONG%3EUpdate%20(2022-02-08%3C%2FSTRONG%3E%3A)%3C%2Fimg%3E%20This%20blog%20has%20been%20updated%20to%20include%20recent%20changes%20in%20the%20feature.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBack%20in%20October%202021%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsecurity-compliance-and-identity%2Fannouncing-adaptive-policy-scopes-for-microsoft-365-records%2Fba-p%2F2857532%22%20target%3D%22_blank%22%3Ewe%20announced%20the%20public%20preview%3C%2FA%3E%20of%20an%20exciting%20new%20Microsoft%20Information%20Governance%20and%20Records%20Management%20feature%20called%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fretention-settings%3Fview%3Do365-worldwide%23configuration-information-for-adaptive-scopes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3Eadaptive%20policy%20scopes%3C%2FSTRONG%3E%3C%2FA%3E.%20This%20feature%26nbsp%3Bprovides%20advanced%20flexibility%20when%20applying%20retention%20policies%20and%20labels%20to%20user%2C%20site%2C%20and%20group%20locations%20in%20Microsoft%20365.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMany%20organizations%20have%20regulatory%2C%20legal%2C%20or%20business%20requirements%20that%20demand%20different%20retention%20rules%20to%20apply%20to%20various%20departments%2C%20locations%2C%20and%20roles.%20Adaptive%20policy%20scopes%20help%20to%20provide%20the%20flexibility%20needed%20to%20achieve%20these%20requirements%20by%20allowing%20administrators%20to%20scope%20policies%20based%20on%20common%20attributes%20and%20properties%20from%20Azure%20AD%20(including%20those%20synced%20from%20on-premises%20AD%20in%20hybrid%20environments)%20or%20indexed%20properties%20from%20SharePoint%20Online%20sites.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%2C%20there%20are%20also%20certain%20scenarios%20in%20which%20an%20organization%20may%20want%20to%20include%20or%20exclude%20locations%20from%20a%20policy%20based%20on%20more%20granular%20attributes%20such%20as%20the%20type%20or%20state%20of%20an%20object.%20This%20is%20particularly%20true%20in%20Exchange%20Online%20as%20several%20different%20types%20of%20mailboxes%20exist.%26nbsp%3B%20The%20most%20common%20types%20of%20mailboxes%20are%20user%20mailboxes%20and%20Microsoft%20365%20group%20mailboxes%20(which%20are%20used%20by%20Microsoft%20365%20Modern%20Groups%20and%20Microsoft%20Teams).%26nbsp%3B%20These%20mailbox%20types%20are%20easily%20targeted%20using%20adaptive%20policy%20scopes%20with%20user%20and%20group%20scopes%2C%20respectively.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20there%20are%20several%20other%20types%20and%20states%20of%20mailboxes%20that%20organizations%20commonly%20use.%26nbsp%3B%20These%20can%20include%20shared%20mailboxes%2C%20resource%20mailboxes%2C%20and%20inactive%20mailboxes.%26nbsp%3B%20This%20blog%20post%20will%20review%20how%20an%20administrator%20can%20create%20scopes%20that%20include%20or%20exclude%20these%20other%20common%20types%20of%20mailboxes%20for%20maximum%20flexibility%20in%20applying%20Microsoft%20365%20retention%20policies%20and%20labels.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-334624696%22%20id%3D%22toc-hId-336528444%22%20id%3D%22toc-hId-336528444%22%3EShared%20mailbox%20retention%20with%20adaptive%20policy%20scopes%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20adaptive%20policy%20scopes%20were%20in%20private%20preview%20one%20of%20the%20most%20common%20requests%20we%20received%20was%20to%20support%20shared%20mailboxes.%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fadmin%2Femail%2Fabout-shared-mailboxes%3Fview%3Do365-worldwide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EShared%20mailboxes%3C%2FA%3E%20are%20used%20by%20organizations%20when%20multiple%20users%20need%20to%20access%20a%20single%20mailbox%20such%20as%20a%20support%2C%20receptionist%2C%20or%20department%20mailbox.%26nbsp%3B%20Unfortunately%2C%20although%20they%20were%20included%20in%20organization-wide%20retention%20policies%20using%20static%20scopes%2C%20we%20were%20unable%20to%20add%20shared%20mailbox%20support%20to%20adaptive%20policy%20scopes%20before%20it%20went%20to%20public%20preview.%26nbsp%3B%20We%20are%20excited%20to%20announce%20that%20support%20for%20shared%20mailboxes%20in%20adaptive%20policy%20scopes%20has%20recently%20been%20fully%20rolled%20out%20and%20you%20can%20now%20create%20scopes%20to%20target%20them%20in%20your%20tenant%20today.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EShared%20mailboxes%20share%20many%20similar%20attributes%20with%20user%20mailboxes.%26nbsp%3B%20There%20are%20several%20ways%20that%20you%20could%20effectively%20target%20them%20in%20adaptive%20policy%20scopes%2C%20such%20as%20using%20department%2C%20location%2C%20or%20even%20some%20custom%20identifiable%20information%20specified%20with%20CustomAttributes1-15.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20let%E2%80%99s%20say%20you%20want%20to%20target%20all%20mailboxes%20that%20are%20in%20the%20legal%20department%20and%20have%20retention%20requirements.%26nbsp%3B%20You%20can%20use%20the%20department%20attribute%20and%20utilize%20one%20of%20the%20custom%20attributes%20to%20identify%20mailboxes%20that%20should%20be%20included%20in%20the%20scope%2C%20which%20are%20all%20available%20options%20in%20the%20simple%20query%20builder%20for%20adaptive%20policy%20scopes%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20simple%20query%20builder%20can%20be%20used%20to%20target%20different%20mailbox%20types%20using%20custom%20attributes.%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F337780iDA3B4019E565AB23%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22fig1.png%22%20alt%3D%22The%20simple%20query%20builder%20can%20be%20used%20to%20target%20different%20mailbox%20types%20using%20custom%20attributes.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20simple%20query%20builder%20can%20be%20used%20to%20target%20different%20mailbox%20types%20using%20custom%20attributes.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH5%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%20id%3D%22toc-hId-1728154496%22%3E%26nbsp%3B%3C%2FH5%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSTRONG%3ENOTE%3A%26nbsp%3B%3C%2FSTRONG%3E%3CEM%3EIf%20your%20organization%20synchronizes%20its%20on-premises%20directory%20with%20Azure%20AD%2C%20for%20synced%20objects%20you%20will%20need%20to%20configure%20most%20attributes%20on-premises%20and%20then%20synchronize%26nbsp%3Bany%20changes%20with%20Azure%20AD%20before%20querying%20them%20in%20adaptive%20policy%20scopes.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%2C%20what%20if%20you%20want%20to%20include%20or%20exclude%20a%20shared%20mailbox%20in%20an%20adaptive%20policy%20scope%20based%20solely%20on%20the%20mailbox%20type%3F%26nbsp%3B%20This%20is%20where%20the%20advanced%20query%20builder%20can%20be%20very%20useful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fretention-settings%3Fview%3Do365-worldwide%23configuration-information-for-adaptive-scopes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eadvanced%20query%20builder%3C%2FA%3E%20is%20an%20alternate%20configuration%20option%20for%20the%20adaptive%20policy%20scopes%20wizard.%20%26nbsp%3BWith%20user%20scopes%20(which%20target%20the%20types%20of%20mailboxes%20we%20are%20discussing%20in%20this%20blog)%2C%20it%20uses%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fopath-filter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOPATH%3C%2FA%3E%20to%20query%20objects.%26nbsp%3B%20You%20can%20access%20the%20advanced%20query%20builder%20by%20clicking%20the%20blue%20button%20at%20the%20top%20of%20the%20simple%20query%20builder%20screen%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20advanced%20query%20builder%20can%20be%20accessed%20using%20the%20button%20in%20the%20top%20right%20of%20the%20simple%20query%20builder.%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338469i9EB733D08DDFF9FD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22advanced-query-builder.gif%22%20alt%3D%22The%20advanced%20query%20builder%20can%20be%20accessed%20using%20the%20button%20in%20the%20top%20right%20of%20the%20simple%20query%20builder.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20advanced%20query%20builder%20can%20be%20accessed%20using%20the%20button%20in%20the%20top%20right%20of%20the%20simple%20query%20builder.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20OPATH%20and%20the%20advanced%20query%20builder%2C%20you%20can%20use%20the%20%3CSTRONG%3ERecipientTypeDetails%3C%2FSTRONG%3E%26nbsp%3Bproperty%26nbsp%3Bof%20the%20mailbox%26nbsp%3Bwith%20the%20%3CEM%3ESharedMailbox%3C%2FEM%3E%20type.%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fexchange%2Fconnect-to-exchange-online-powershell%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EExchange%20Online%20PowerShell%3C%2FA%3E%20can%20be%20used%20to%20test%20the%20OPATH%20query%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EUpdate%20(2022-02-08)%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3EThis%20article%20previously%20recommended%20using%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%20font-style%3A%20italic%3B%22%3EIsShared%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3Eproperty%26nbsp%3Bbut%20since%20then%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%20font-style%3A%20italic%3B%22%3ERecipientTypeDetails%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3E%20has%20been%20supported.%26nbsp%3B%20RecipientTypeDetails%20is%20a%20better%20choice%20for%20shared%20mailboxes%20as%20it%20excludes%20certain%20system%20mailboxes%20such%20as%20discovery%20search%20mailboxes.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-Mailbox%20-Filter%20%7BRecipientTypeDetails%20-eq%20%22SharedMailbox%22%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0ATestSharedMailbox20211...%20testsharedma...%20NAMPR13DG031-db016%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0ATestSharedMailbox22022...%20testsharedma...%20NAMPR13DG091-db016%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%2C%20simply%20input%20the%20OPATH%20query%20into%20the%20advanced%20query%20builder%20within%20the%20adaptive%20policy%20scope%20wizard%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20SharedMailboxes%20using%20RecipientTypeDetails%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346243i24E2F67432BFE663%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22SharedMailbox.png%22%20alt%3D%22The%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20SharedMailboxes%20using%20RecipientTypeDetails%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20SharedMailboxes%20using%20RecipientTypeDetails%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%26nbsp%3B%3CEM%3EFor%20more%20examples%20of%20using%20OPATH%20and%20the%20advanced%20query%20builder%2C%20check%20out%20our%20recent%20webinar%20%3CA%20href%3D%22https%3A%2F%2Fmipc.eventbuilder.com%2Fevent%2F52683%2Foccurrence%2F49452%2Frecording%3Frauth%3D853.3181650.1f2b6e8b4a05b4441f19b890dfeadcec24c4325e90ac492b7a58eb3045c546ea%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EBuilding%20Advanced%20Queries%20for%20Users%20and%20Groups%20with%20Adaptive%20Policy%20Scopes%3C%2FA%3E.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1014683066%22%20id%3D%22toc-hId-1016586814%22%20id%3D%22toc-hId-1016586814%22%3EResource%20mailbox%20retention%20using%20adaptive%20policy%20scopes%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELike%20shared%20mailboxes%2C%20resource%20mailboxes%20were%20also%20not%20available%20for%20use%20in%20adaptive%20policy%20scopes%20at%20the%20launch%20of%20the%20public%20preview%2C%20but%20now%20are%20available%20to%20use%20in%20your%20tenant%20today.%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Frecipients-in-exchange-online%2Fmanage-resource-mailboxes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EResource%20mailboxes%3C%2FA%3E%20are%20used%20to%20help%20manage%20physical%20resources%20in%20Exchange%20Online.%26nbsp%3B%20There%20are%20two%20different%20types%20of%20resource%20mailboxes%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ERoom%20mailbox%3C%2FSTRONG%3E%20is%20a%20resource%20mailbox%20that%20is%20assigned%20to%20a%20physical%20location%2C%20such%20as%20a%20conference%20room.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EEquipment%20mailbox%3C%2FSTRONG%3E%20is%20a%20mailbox%20assigned%20to%20a%20resource%20that%20is%20not%20location-specific%2C%20such%20as%20a%20projector.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnlike%20shared%20mailboxes%2C%20however%2C%20resource%20mailboxes%20historically%20have%20never%20been%20included%20in%20Microsoft%20365%20retention%20policies.%26nbsp%3B%20Now%2C%20with%20adaptive%20policy%20scopes%2C%20you%20can%20create%20policies%20specifically%20for%20your%20organization%E2%80%99s%20room%20and%20equipment%20mailboxes%20(such%20as%20a%20policy%20to%20delete%20items%20after%201%20year)%20or%20include%20them%20in%20your%20organization's%20existing%20retention%20policies.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20resource%20mailboxes%20are%20very%20similar%20to%20shared%20mailboxes%2C%20most%20of%20the%20options%20an%20administrator%20has%20for%20filterable%20properties%20are%20the%20same.%26nbsp%3B%20For%20filtering%20by%20mailbox%20type%20using%20OPATH%20and%20the%20advanced%20query%20builder%2C%20you%20can%20again%20use%20the%20property%20%3CEM%3E%3CSTRONG%3ERecipientTypeDetails%3C%2FSTRONG%3E%20%3C%2FEM%3Ewith%26nbsp%3B%3CEM%3ERoomMailbox%3C%2FEM%3E%20or%26nbsp%3B%3CEM%3EEquipmentMailbox%3C%2FEM%3E%20types%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EUpdate%20(2022-02-08)%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3EThis%20article%20previously%20recommended%20using%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%20font-style%3A%20italic%3B%22%3EIsResource%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3Eproperty%26nbsp%3Bbut%20since%20then%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%20font-style%3A%20italic%3B%22%3ERecipientTypeDetails%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3E%20has%20been%20supported.%26nbsp%3B%20RecipientTypeDetails%20is%20a%20better%20choice%20for%20resource%20mailboxes%20as%20allows%20you%20to%20distinguish%20between%20room%20and%20equipment%20mailboxes.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--91706819%22%20id%3D%22toc-hId--89803071%22%20id%3D%22toc-hId--89803071%22%3EOPATH%20in%20Exchange%20Online%20PowerShell%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-Mailbox%20-Filter%20%7BRecipientTypeDetails%20-eq%20%22RoomMailbox%22%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0AtestRoomMailbox%20%20%20%20%20%20%20%20%20%20%20testRoomMailbox%20namPR13DG304-db141%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0A%0A%0AGet-Mailbox%20-Filter%20%7BRecipientTypeDetails%20-eq%20%22EquipmentMailbox%22%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0AtestEquipmentMailbox%20%20%20%20%20%20testEquipmen...%20NAMPR13DG086-db021%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0A%0A%0AGet-Mailbox%20-Filter%20%7BRecipientTypeDetails%20-eq%20%22RoomMailbox%22%20-or%20RecipientTypeDetails%20-eq%20%22EquipmentMailbox%22%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0AtestRoomMailbox%20%20%20%20%20%20%20%20%20%20%20testRoomMailbox%20namPR13DG304-db141%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0AtestEquipmentMailbox%20%20%20%20%20%20testEquipmen...%20NAMPR13DG086-db021%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1899161282%22%20id%3D%22toc-hId--1897257534%22%20id%3D%22toc-hId--1897257534%22%3EOPATH%20in%20the%20advanced%20query%20builder%20-%20including%20both%20room%20and%20equipment%20mailboxes%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20room%20or%20equipment%20mailboxes%20using%20RecipientTypeDetails%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346246iDE0FE33BC43C335B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22resource.png%22%20alt%3D%22The%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20room%20or%20equipment%20mailboxes%20using%20RecipientTypeDetails%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20advanced%20query%20builder%20can%20use%20OPATH%20to%20filter%20room%20or%20equipment%20mailboxes%20using%20RecipientTypeDetails%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--112713027%22%20id%3D%22toc-hId--110809279%22%20id%3D%22toc-hId--110809279%22%3EInactive%20mailbox%20retention%20using%20adaptive%20policy%20scopes%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnlike%20shared%20and%20resource%20mailboxes%2C%20inactive%20mailboxes%20have%20been%20supported%20with%20adaptive%20policy%20scopes%20since%20the%20public%20preview%20release.%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Finactive-mailboxes-in-office-365%3Fview%3Do365-worldwide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInactive%20mailboxes%3C%2FA%3E%20are%20not%20a%20mailbox%20type%3B%20they%20are%20instead%20a%20mailbox%20state.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20a%20user%20object%20is%20deleted%20from%20Azure%20AD%20(such%20as%20when%20an%20employee%20leaves%20the%20organization)%2C%20the%20Microsoft%20365%20license%20once%20again%20becomes%20available.%26nbsp%3B%20But%2C%20if%20the%20associated%20mailbox%20has%20a%20legal%20or%20regulatory%20hold%20applied%20to%20it%2C%20we%20cannot%20delete%20the%20mailbox%20so%2C%20instead%2C%20it%20becomes%20inactive.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20adaptive%20policy%20scopes%2C%20retention%20policies%20that%20applied%20to%20the%20entire%20organization%20(org-wide)%20for%20the%20Exchange%20location%20would%20automatically%20affect%20inactive%20mailboxes.%20However%2C%20there%20was%20no%20efficient%20way%20to%20have%20a%20retention%20policy%20specific%20to%20inactive%20mailboxes%20until%20now.%26nbsp%3B%20For%20example%2C%20an%20organization%20may%20choose%20to%20keep%20inactive%20mailbox%20data%20for%201%20year%20after%20an%20employee%20leaves%20but%20keep%20the%20data%20of%20active%20employees%20for%205%20years.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20adaptive%20policy%20scopes%2C%20you%20can%20target%20inactive%20mailboxes%20using%20the%20advanced%20query%20builder%20similarly%20to%20how%20you%20would%20for%20shared%20and%20resource%20mailboxes%2C%20but%20using%20the%20%3CEM%3E%3CSTRONG%3EIsInactiveMailbox%3C%2FSTRONG%3E%20%3C%2FEM%3Eproperty%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1219102912%22%20id%3D%22toc-hId--1217199164%22%20id%3D%22toc-hId--1217199164%22%3EOPATH%20in%20Exchange%20Online%20PowerShell%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-Mailbox%20-IncludeInactiveMailbox%20-Filter%20%7BIsInactiveMailbox%20-eq%20%22True%22%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0AinactivemailboxTest%20%20%20%20%20%20%20inactivemail...%20NAMPR13DG282-db075%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%26nbsp%3B%3CEM%3EYou%20can%20also%20filter%20on%20other%20properties%20such%20as%20department%2C%20location%2C%20and%20custom%20attributes%20however%20once%20a%20mailbox%20is%20made%20inactive%2C%20those%20properties%20cannot%20be%20changed.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-567345343%22%20id%3D%22toc-hId-569249091%22%20id%3D%22toc-hId-569249091%22%3EApplying%20a%20scope%20to%20multiple%20mailbox%20types%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20major%20benefits%20of%20adaptive%20policy%20scopes%20is%20how%20powerful%20they%20can%20be.%26nbsp%3B%20Administrators%20can%20create%20extremely%20complex%20queries%20allowing%20virtually%20any%20requirement%20to%20be%20achievable.%26nbsp%3B%20As%20a%20more%20advanced%20example%2C%20the%20following%20scope%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%26nbsp%3Bapplies%20to%20shared%20mailboxes%2C%20room%20mailboxes%2C%20but%20excludes%20all%20inactive%20mailboxes%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EUpdate%20(2022-02-08)%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3EThis%20article%20previously%20recommended%20using%20the%20%3CSTRONG%3EIsShared%3C%2FSTRONG%3E%20and%20%3CSTRONG%3EIsResource%26nbsp%3B%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3Eproperties%20but%20since%20then%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%20font-style%3A%20italic%3B%22%3ERecipientTypeDetails%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20italic%3B%22%3E%20has%20been%20supported.%26nbsp%3B%20RecipientTypeDetails%20is%20a%20better%20choice%20for%20shared%20and%20resource%20mailboxes%20as%20it%20excludes%20certain%20system%20mailboxes%20such%20as%20discovery%20search%20mailboxes%20and%20allows%20distinction%20between%20resource%20mailbox%20types.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--539044542%22%20id%3D%22toc-hId--537140794%22%20id%3D%22toc-hId--537140794%22%3EOPATH%20in%20Exchange%20Online%20PowerShell%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-Mailbox%20-Filter%20%7B((RecipientTypeDetails%20-eq%20%22RoomMailbox%22)%20-or%20(RecipientTypeDetails%20-eq%20%22SharedMailbox%22))%20-and%20(IsInactiveMailbox%20-eq%20%22False%22)%7D%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Alias%20%20%20%20%20%20%20%20%20%20%20Database%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ProhibitSendQuota%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----%20%20%20%20%20%20%20%20%20%20%20--------%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-----------------%0ATestSharedMailbox20211...%20testsharedma...%20NAMPR13DG031-db016%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0ATestSharedMailbox22022...%20testsharedma...%20NAMPR13DG091-db016%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%0AtestRoomMailbox%20%20%20%20%20%20%20%20%20%20%20testRoomMailbox%20namPR13DG304-db141%20%20%20%20%20%20%20%20%20%20%20%20%2099%20GB%20(106%2C300%2C44...%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20style%3D%22%20text-align%20%3A%20left%3B%20%22%20id%3D%22toc-hId-1950372039%22%3EOPATH%20in%20the%20advanced%20query%20builder%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OPATH%20and%20the%20advanced%20query%20builder%20allow%20for%20complex%20but%20flexible%20scoping.%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346247i792175E092A9AF1F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22advanced-query.png%22%20alt%3D%22OPATH%20and%20the%20advanced%20query%20builder%20allow%20for%20complex%20but%20flexible%20scoping.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOPATH%20and%20the%20advanced%20query%20builder%20allow%20for%20complex%20but%20flexible%20scoping.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1113718989%22%20id%3D%22toc-hId-1115622737%22%20id%3D%22toc-hId-1115622737%22%3EValidating%20Advanced%20Queries%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EUpdate%20(2022-02-08)%26nbsp%3B%3C%2FSTRONG%3EPreviously%2C%20we%20never%20had%26nbsp%3B%20any%20validation%20for%20OPATH%20queries.%26nbsp%3B%20That%20meant%20if%20the%20query%20was%20incorrectly%20formatted%20you%20would%20only%20know%20after%20waiting%20several%20days%20for%20the%20scope%20the%20populate.%26nbsp%3B%20We've%20since%20released%20basic%20query%20validation%20for%20OPATH.%26nbsp%3B%20If%20an%20incorrect%20query%20is%20entered%20and%20the%20scope%20is%20saved%2Fcreated%2C%20an%20error%20message%20will%20display%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OPATH%20queries%20are%20now%20validated%20before%20saving.%22%20style%3D%22width%3A%20716px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346252i48CA79E20CC7B670%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22validation.png%22%20alt%3D%22OPATH%20queries%20are%20now%20validated%20before%20saving.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOPATH%20queries%20are%20now%20validated%20before%20saving.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%2C%20you%20may%20want%20to%20know%20which%20objects%20will%20match%20the%20query%20while%20building%20it.%26nbsp%3B%20To%20help%20understand%20what%20objects%20a%20query%20will%20return%2C%20we've%20created%20a%20script%20that%20can%20be%20used%20to%20validate%20OPATH%20queries%20for%20user%20and%20group%20scopes.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EYou%20can%20view%20and%20download%20the%20validation%20script%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fbrenle.github.io%2FMIGScripts%2Fexo%2Fvalidate-adaptivescopesopathquery%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EValidate-AdaptiveScopesOPATHQuery.ps1%20-%20MIGScripts%20(brenle.github.io)%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlso%2C%20as%20we%20previously%20stated%2C%20we%20hosted%20a%20recent%20webinar%20that%20discussed%20building%20advanced%20queries%20for%20user%20and%20group%20scopes.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWatch%20it%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fmipc.eventbuilder.com%2Fevent%2F52683%2Foccurrence%2F49452%2Frecording%3Frauth%3D853.3181650.1f2b6e8b4a05b4441f19b890dfeadcec24c4325e90ac492b7a58eb3045c546ea%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EBuilding%20Advanced%20Queries%20for%20Users%20and%20Groups%20with%20Adaptive%20Policy%20Scopes%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20validation%20script%20allows%20testing%20results%20from%20an%20OPATH%20query.%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F337795iE4F91E7B8AFF52D4%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22fig11.png%22%20alt%3D%22The%20validation%20script%20allows%20testing%20results%20from%20an%20OPATH%20query.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20validation%20script%20allows%20testing%20results%20from%20an%20OPATH%20query.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20script%20will%20give%20a%20sample%20output%20and%20allow%20export%20if%20-ExportCSV%20is%20specified.%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F337796i88C943514880ABF0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22fig12.png%22%20alt%3D%22The%20script%20will%20give%20a%20sample%20output%20and%20allow%20export%20if%20-ExportCSV%20is%20specified.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20script%20will%20give%20a%20sample%20output%20and%20allow%20export%20if%20-ExportCSV%20is%20specified.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--693735474%22%20id%3D%22toc-hId--691831726%22%20id%3D%22toc-hId--691831726%22%3EFAQ%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20scope%20type%20should%20I%20use%20for%20shared%2C%20resource%2C%20or%20inactive%20mailboxes%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EFor%20shared%2C%20resource%2C%20and%20inactive%20mailboxes%2C%20you%20should%20use%20the%20%E2%80%9Cuser%E2%80%9D%20scope%20type%20as%20they%20all%20refer%20to%20user%20objects%20in%20Azure%20AD.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDo%20I%20need%20to%20use%20the%20advanced%20query%20builder%20and%20OPATH%20for%20shared%2C%20resource%2C%20and%20inactive%20mailboxes%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EBy%20default%2C%20all%20mailbox%20types%20are%20included%20in%20the%20scope.%26nbsp%3B%20So%2C%20if%20you%20don't%20need%20to%20exclude%20any%20of%20these%20mailbox%20types%2C%20you%20can%20use%20the%20simple%20query%20builder%20provided%20the%20properties%20needed%20are%20available.%26nbsp%3B%20If%20you%20do%20need%20to%20exclude%20one%20or%20more%20of%20these%20mailbox%20types%20or%20if%20the%20simple%20query%20builder%20doesn't%20have%20a%20property%20that%20you%20need%20to%20filter%2C%20you%20will%20need%20to%20use%20OPATH%20and%20the%20advanced%20query%20builder%26nbsp%3Bas%26nbsp%3B%3CEM%3E%3CSTRONG%3ERecipientTypeDetails%2C%20IsShared%3C%2FSTRONG%3E%3C%2FEM%3E%2C%20%3CEM%3E%3CSTRONG%3EIsResource%2C%3C%2FSTRONG%3E%3C%2FEM%3E%20and%20%3CEM%3E%3CSTRONG%3EIsInactiveMailbox%3C%2FSTRONG%3E%20%3C%2FEM%3Eproperties%20are%20not%20currently%20available%20in%20the%20simple%20query%20builder.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20if%20I%20have%20already%20created%20scopes%20for%20my%20organization%20but%20didn%E2%80%99t%20take%20into%20consideration%20shared%2C%20resource%20or%20inactive%20mailboxes%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIf%20your%20existing%20scope%20doesn%E2%80%99t%20already%20exclude%20the%20types%20of%20mailboxes%20you%20don%E2%80%99t%20want%20included%20you%20should%20consider%20modifying%20the%20scopes%20using%20the%20above%20properties.%26nbsp%3B%20If%20your%20existing%20scope%20uses%20a%20query%20built%20with%20the%20simple%20query%20builder%2C%20you%20will%20need%20to%20convert%20your%20query%20to%20OPATH%20and%20use%20the%20advanced%20query%20builder.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDo%20shared%20and%20resource%20mailboxes%20need%20to%20be%20licensed%20to%20use%20with%20adaptive%20policy%20scopes%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EYes%2C%20as%20with%20user%20mailboxes%2C%20shared%20and%20resource%20mailboxes%20need%20to%20have%20an%20applicable%20license%20applied%20for%20compliant%20usage%20with%20adaptive%20policy%20scopes.%26nbsp%3B%20As%20of%20the%20publish%20date%20of%20this%20blog%20these%20licenses%20include%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMicrosoft%20365%20E5%2FA5%2FG5%3C%2FLI%3E%0A%3CLI%3EMicrosoft%20365%20E5%2FA5%2FG5%20Compliance%3C%2FLI%3E%0A%3CLI%3EMicrosoft%20365%20E5%2FA5%20Information%20Protection%20and%20Governance%3C%2FLI%3E%0A%3CLI%3EMicrosoft%20365%20F5%20Compliance%3C%2FLI%3E%0A%3CLI%3EMicrosoft%20365%20F5%20Security%20and%20Compliance%3C%2FLI%3E%0A%3CLI%3EOffice%20365%20E5%2FA5%2FG5%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHow%20do%20you%20appropriately%20license%20an%20inactive%20mailbox%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EInactive%20mailboxes%20must%20have%20the%20appropriate%20license%20assigned%20to%20the%20mailbox%20before%20making%20it%20inactive.%26nbsp%3B%20Once%20the%20mailbox%20is%20made%20inactive%20the%20license%20will%20be%20free%20to%20use%20elsewhere.%20For%20more%20information%2C%20see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fcreate-and-manage-inactive-mailboxes%3Fview%3Do365-worldwide%23create-an-inactive-mailbox%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecreate%20an%20inactive%20mailbox.%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3053641%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20blog%20we'll%20explain%20how%20you%20can%20now%20use%20adaptive%20policy%20scopes%20to%20include%20or%20exclude%20shared%2C%20resource%2C%20and%20inactive%20mailboxes%20from%20Microsoft%20365%20retention%20policies%20and%20labels.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MSFT_SCI_Comprehensive_Security_02.jpg%22%20style%3D%22width%3A%20539px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338709i0CE6516141648102%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MSFT_SCI_Comprehensive_Security_02.jpg%22%20alt%3D%22MSFT_SCI_Comprehensive_Security_02.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3053641%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompliance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Information%20Governance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERecords%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3270537%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Adaptive%20Policy%20Scopes%20to%20Apply%20M365%20Retention%20to%20Shared%2C%20Resource%2C%20and%20Inactive%20Mailboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3270537%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EThose%20are%20great%20additions%2C%20thank%20you%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Feb 08 2022 08:23 AM
Updated by:
We support Ukraine and condemn war. Push Russian government to act against war. Be brave, vocal and show your support to Ukraine. Follow the latest news HERE