/flags/exchange-online/get-exomailbox-propertysets
Get-EXOMailbox -PropertySets: return archive, quota, hold or delivery properties
- 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.
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 LitigationHoldEnabledValid 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):
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 set | Typical properties |
|---|---|
| Minimum (default) | Alias, DisplayName, EmailAddresses, Guid, Name, PrimarySmtpAddress, RecipientTypeDetails, UserPrincipalName |
| Archive | ArchiveStatus, ArchiveName, ArchiveQuota, AutoExpandingArchiveEnabled |
| Audit | AuditEnabled, AuditAdmin, AuditDelegate, AuditOwner, AuditLogAgeLimit |
| Custom | CustomAttribute1-15, ExtensionCustomAttribute1-5 |
| Delivery | ForwardingAddress, ForwardingSmtpAddress, DeliverToMailboxAndForward, GrantSendOnBehalfTo, MaxSendSize |
| Hold | LitigationHoldEnabled, InPlaceHolds, ComplianceTagHoldApplied, DelayHoldApplied |
| Moderation | ModerationEnabled, ModeratedBy |
| Quota | quota and warning sizes |
| All | every 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
Deliveryset; 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-Mailboxreturns 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 Allon everything. - Not connected. Like every Exchange cmdlet, it needs
Connect-ExchangeOnlinefirst (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.