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 Configuration Manager.
Device affinity in System Center 2012 Configuration Manager associates a user with one or more devices. Instead of deploying applications to all the user’s devices, you deploy the application to the user and System Center 2012 Configuration Manager automatically installs the application on all devices that are associated with that user. Device affinity removes the need for System Center 2012 Configuration Manager to determine the names of the user’s devices before you deploy applications for that user.
For more information about user device affinity, see How to Manage User Device Affinity in Configuration Manager 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 a user by using an ID.
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 specifying a user ID
This command adds affinity to the device named "WestDivUpdates05" for the user named "Sarah Jones".
PS C:\> Remove-CMDeviceAffinityFromUser -UserName "Sarah Jones" -DeviceName "WestDivUpdates05"
Related topics
Approve-CMUserDeviceAffinityRequest
Deny-CMUserDeviceAffinityRequest
Get-CMUserDeviceAffinityRequest
UserDeviceAffinityRequest
UserDeviceAffinityRequestId