Skip to main content

SYNOPSIS

Compare two user attributes from different sources.

SYNTAX

DESCRIPTION

This function compares two specified user attributes from Active Directory, Entra ID (Microsoft Graph), or Exchange. It can filter users based on email domain or specific user identities and returns users whose attributes either match or do not match.

EXAMPLES

EXAMPLE 1

Compares the ‘mail’ and ‘proxyAddresses’ attributes for users in Active Directory and returns those with matching values.

EXAMPLE 2

Compares the ‘userPrincipalName’ and ‘mail’ attributes for users in Entra ID and returns those with non-matching values.

PARAMETERS

-Attribute1

The first user attribute to compare.

-Attribute2

The second user attribute to compare.

-Source

The source from which to retrieve user information. Valid options are ‘AD’ for Active Directory, ‘EntraID’ for Microsoft Entra ID, and ‘Exchange’ for Exchange.

-User

An array of user identities to filter the comparison.

-ByDomain

An array of email domains to filter users.

-Return

Specifies whether to return users with ‘Matching’ or ‘NotMatching’ attributes.

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

https://ps365.clidsys.com/docs/commands/Compare-UserAttribute