Get-CMUserDeviceAffinity

SYNOPSIS

Gets a Configuration Manager user's device affinities.

SYNTAX

SearchByUserNameMandatory (Default)

Get-CMUserDeviceAffinity -UserName <String[]> [-DisableWildcardHandling] [-ForceWildcardHandling]
 [<CommonParameters>]

SearchByDeviceNameMandatory

Get-CMUserDeviceAffinity -DeviceName <String[]> [-DisableWildcardHandling] [-ForceWildcardHandling]
 [<CommonParameters>]

SearchByDeviceIdMandatory

Get-CMUserDeviceAffinity -DeviceId <String[]> [-DisableWildcardHandling] [-ForceWildcardHandling]
 [<CommonParameters>]

SearchByUserIdMandatory

Get-CMUserDeviceAffinity -UserId <String[]> [-DisableWildcardHandling] [-ForceWildcardHandling]
 [<CommonParameters>]

DESCRIPTION

The Get-CMUserDeviceAffinity cmdlet gets one or more user device affinities in Microsoft System Center Configuration Manager.

User device affinity in Microsoft System Center Configuration Manager is a method of associating a user with one or more specified devices.

EXAMPLES

Example 1: Get a user device affinity by using a user name

PS C:\> Get-CMUserDeviceAffinity -UserName "CENTRAL\001D$"

This command gets the user device affinity for the user named CENTRAL\001D$.

Example 2: Get a user device affinity by using a user ID

PS C:\> Get-CMUserDeviceAffinity -UserID "2063597981"

This command gets the user device affinity for the user that has the ID named 2063597981.

Example 3: Get a user device affinity by using a device name

PS C:\> Get-CMUserDeviceAffinity -DeviceName "CMCEN-DIST02"

This command gets the user device affinity for the device named CMCEN-DIST02.

Example 4: Get a user device affinity by using a device ID

PS C:\> Get-CMUserDeviceAffinity -DeviceID "2097152000"

This command gets the user device affinity for the device that has the ID 2097152000.

PARAMETERS

-DeviceId

Specifies an array of device IDs.

Type: String[]
Parameter Sets: SearchByDeviceIdMandatory
Aliases: ResourceId

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

-DeviceName

Specifies an array of device names.

Type: String[]
Parameter Sets: SearchByDeviceNameMandatory
Aliases: ResourceName

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

-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

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

-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

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

-UserId

Specifies an array of IDs of the primary users of the devices.

Type: String[]
Parameter Sets: SearchByUserIdMandatory
Aliases: 

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

-UserName

Specifies an array of names of the primary users of the devices.

Type: String[]
Parameter Sets: SearchByUserNameMandatory
Aliases: UniqueUserName

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

INPUTS

OUTPUTS

NOTES

Approve-CMUserDeviceAffinityRequest

Deny-CMUserDeviceAffinityRequest

Get-CMUserDeviceAffinityRequest

Import-CMUserDeviceAffinity