Remove-CMDeviceAffinityFromUser

Remove-CMDeviceAffinityFromUser

Removes device affinity from a Configuration Manager user.

Syntax

Parameter Set: RemoveDeviceAffinityByUserName
Remove-CMDeviceAffinityFromUser -UserName <String[]> [-DeviceId <String> ] [-DeviceName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RemoveDeviceAffinityByUserId
Remove-CMDeviceAffinityFromUser -UserId <String> [-DeviceId <String> ] [-DeviceName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-CMDeviceAffinityFromUser cmdlet removes device affinity from a user of Microsoft System Center 2012 SP1 Configuration Manager.

Device affinity in Configuration Manager associates a user with one or more devices. Instead of deploying applications to all the devices of a user, you deploy the application to the user and Configuration Manager automatically installs the application on all devices that are associated with that user. Device affinity removes the need for Configuration Manager to determine the names of all the devices of a user before you deploy applications for that user.

For more information about user device affinity, see How to Manage User Device Affinity in Configuration Manager (https://go.microsoft.com/fwlink/?linkid=247182) on TechNet.

Parameters

-DeviceId<String>

Specifies a device by using an ID.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DeviceName<String>

Specifies a device by using a name.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UserId<String>

Specifies a user by using an ID.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UserName<String[]>

Specifies an array of user names.

Aliases

UniqueUserName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Remove device affinity from a user by user ID

This command adds affinity to the device named WestDivUpdates05 for the user named Patti Fuller.

PS C:\> Remove-CMDeviceAffinityFromUser -UserName "Patti Fuller" -DeviceName "WestDivUpdates05"

Add-CMDeviceAffinityToUser

Approve-CMUserDeviceAffinityRequest

Deny-CMUserDeviceAffinityRequest

Get-CMUserDeviceAffinity

Get-CMUserDeviceAffinityRequest

Import-CMUserDeviceAffinity