Get-CMUserDeviceAffinity

Gets user device affinities.

Syntax

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

Description

The Get-CMUserDeviceAffinity cmdlet gets one or more user device affinities. 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.

Required Parameters

-DeviceId

Specifies an array of device IDs.

Type:String[]
Aliases:ResourceId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeviceName

Specifies an array of device names.

Type:String[]
Aliases:ResourceName
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[]
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[]
Aliases:UniqueUserName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-DisableWildcardHandling

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

Type:SwitchParameter
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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False