> ## Documentation Index
> Fetch the complete documentation index at: https://ps365.clidsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare UserAttribute

## SYNOPSIS

Compare two user attributes from different sources.

## SYNTAX

```powershell theme={null}
Compare-UserAttribute [-Attribute1] <String> [-Attribute2] <String> [-Source] <String> [[-User] <String[]>]
 [[-ByDomain] <String[]>] [-Return] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## 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

```powershell theme={null}
Compare-UserAttribute -Attribute1 "mail" -Attribute2 "proxyAddresses" -
```

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

### EXAMPLE 2

```powershell theme={null}
Compare-UserAttribute -Attribute1 "userPrincipalName" -Attribute2 "mail" -Source "EntraID" -Return "NotMatching"
```

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.

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Attribute2

The second user attribute to compare.

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -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.

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -User

An array of user identities to filter the comparison.

```yaml theme={null}
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ByDomain

An array of email domains to filter users.

```yaml theme={null}
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Return

Specifies whether to return users with 'Matching' or 'NotMatching' attributes.

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 6
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](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[https://ps365.clidsys.com/docs/commands/Compare-UserAttribute](https://ps365.clidsys.com/docs/commands/Compare-UserAttribute)
