Skip to content

/flags/exchange-online/get-exomailbox-propertysets

Get-EXOMailbox -PropertySets: return archive, quota, hold or delivery properties

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
tool
Exchange Online PowerShell
command
Get-EXOMailbox
flag
-PropertySets
default
Minimum

Get-EXOMailbox -PropertySets Archive,Quota returns the properties of the named property sets in addition to the default minimum set. Get-EXOMailbox, the REST cmdlet of Exchange Online PowerShell V3, deliberately returns only a small set of properties (the Minimum set) to stay fast; properties outside it, such as quotas, holds or forwarding, appear empty unless you request them with -PropertySets or -Properties.

powershell
Connect-ExchangeOnline -UserPrincipalName admin@contoso.com
Get-EXOMailbox -Identity anna@contoso.com -PropertySets Quota
Get-EXOMailbox -ResultSize Unlimited -PropertySets Archive |
  Where-Object ArchiveStatus -eq 'Active' | Select-Object DisplayName, ArchiveName
Get-EXOMailbox -PropertySets Delivery -Properties LitigationHoldEnabled

Valid values

The reference lists the values and notes that Minimum is the default. They are checked by PowerShell when the parameter is bound, so the list can be read offline from the module (ExchangeOnlineManagement 3.10.1, Windows PowerShell 5.1, no connection):

powershell
Import-Module ExchangeOnlineManagement
$p = (Get-Command Get-EXOMailbox).Parameters['PropertySets']
"Type: " + $p.ParameterType.Name
[enum]::GetNames($p.ParameterType.GetElementType()) -join ', '
try { Get-EXOMailbox -PropertySets Forwarding -ErrorAction Stop } catch { $_.Exception.Message }

Output

Type: PropertySet[]
All, Minimum, AddressList, Archive, Audit, Custom, Delivery, Hold, Moderation, Move, Policy, PublicFolder, Quota, Resource, Retention, SCL, SoftDelete, StatisticsSeed
Cannot bind parameter 'PropertySets'. Cannot convert value "Forwarding" to type "Microsoft.Exchange.Management.RestApiClient.GetExoMailbox+PropertySet". Error: "Unable to match the identifier name Forwarding to a valid enumerator name. Specify one of the following enumerator names and try again:
All, Minimum, AddressList, Archive, Audit, Custom, Delivery, Hold, Moderation, Move, Policy, PublicFolder, Quota, Resource, Retention, SCL, SoftDelete, StatisticsSeed"
Property setTypical properties
Minimum (default)Alias, DisplayName, EmailAddresses, Guid, Name, PrimarySmtpAddress, RecipientTypeDetails, UserPrincipalName
ArchiveArchiveStatus, ArchiveName, ArchiveQuota, AutoExpandingArchiveEnabled
AuditAuditEnabled, AuditAdmin, AuditDelegate, AuditOwner, AuditLogAgeLimit
CustomCustomAttribute1-15, ExtensionCustomAttribute1-5
DeliveryForwardingAddress, ForwardingSmtpAddress, DeliverToMailboxAndForward, GrantSendOnBehalfTo, MaxSendSize
HoldLitigationHoldEnabled, InPlaceHolds, ComplianceTagHoldApplied, DelayHoldApplied
ModerationModerationEnabled, ModeratedBy
Quotaquota and warning sizes
Allevery property

The full list of properties in each set is on Microsoft's property sets page.

Pitfalls

  • Empty columns are not empty values. A property that was not requested is shown as blank or null. Before concluding that no mailbox forwards mail, request the Delivery set; see ForwardingSmtpAddress.
  • Wrong name. A set that does not exist, such as Forwarding, fails at binding with the list of valid names, as shown above.
  • Get-Mailbox differs. The older Get-Mailbox returns all properties and has no -PropertySets; see Get-EXOMailbox vs Get-Mailbox.
  • Large tenants. Combine sets with a filter and -ResultSize Unlimited (-ResultSize Unlimited) rather than -PropertySets All on everything.
  • Not connected. Like every Exchange cmdlet, it needs Connect-ExchangeOnline first (You must call Connect-ExchangeOnline).

FAQ

Why are ForwardingSmtpAddress or LitigationHoldEnabled empty in Get-EXOMailbox output?

They are not in the Minimum property set that Get-EXOMailbox returns by default. Request them with -Properties ForwardingSmtpAddress,LitigationHoldEnabled or with the Delivery and Hold property sets.

Can I combine -PropertySets and -Properties?

Yes. The reference shows Get-EXOMailbox -Properties Name,DistinguishedName,Guid -PropertySets Archive,Audit, which returns the Minimum set plus both property sets and the named properties.

Is -PropertySets All a good idea?

For one mailbox, yes. For the whole tenant it downloads every property of every mailbox, which is what Get-EXOMailbox was designed to avoid. Pick the sets you need.

Sources