Get-ExMailboxFromAttribute
SYNOPSIS
Get mailboxes based on a custom attribute and compare specified attributes.
SYNTAX
Get-ExMailboxFromAttribute [-Attribute] <String> [[-CheckAttributes] <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
This function retrieves mailboxes based on a custom attribute and compares specified attributes. It returns a list of mailboxes along with their primary SMTP address, the custom attribute value, and whether the specified attributes match. It's more or less a Get-Mailbox with specific filter
EXAMPLES
EXAMPLE 1
Get-ExMailboxFromAttribute -Attribute "CustomAttribute" -CheckAttributes @("Attribute1", "Attribute2")
This example retrieves mailboxes with the custom attribute "CustomAttribute" and compares the values of "Attribute1" and "Attribute2".
EXAMPLE 2
Get-ExMailboxFromAttribute -Attribute "CustomAttribute"
This example retrieves mailboxes with the custom attribute "CustomAttribute" without comparing any attributes.
PARAMETERS
-Attribute
The custom attribute to retrieve from the mailboxes.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CheckAttributes
Optional. An array of two attributes to compare. If specified, the function checks if the values of these attributes match. Can be useful to compare two attributes for examples
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
You can also use Get-AttributeMatching to compare two attributes directly in AD/Exchange/Entra ID