Remove-CMUserAffinityFromDevice
Remove-CMUserAffinityFromDevice
Removes a primary user from one or more devices in the Configuration Manager hierarchy.
Syntax
Parameter Set: RemoveUserAffinityByDeviceName
Remove-CMUserAffinityFromDevice -DeviceName <String[]> [-Force] [-UserId <String> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: RemoveUserAffinityByDeviceId
Remove-CMUserAffinityFromDevice -DeviceId <String[]> [-Force] [-UserId <String> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMUserAffinityFromDevice cmdlet removes a primary user from the devices.
User device affinity is a method of associating a user with one or more specified devices in System Center 2012 Configuration Manager.
Parameters
-DeviceId<String[]>
Specifies an array of IDs of the devices.
Aliases |
ResourceId |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DeviceName<String[]>
Specifies an array of names of the devices.
Aliases |
ResourceName |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-UserId<String>
Specifies the ID of a user.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-UserName<String>
Specifies the name of the primary user that you want to disassociate from the specified devices.
Aliases |
none |
Required? |
false |
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 a primary user from a device
This command removes the association between the user that has the ID 206359374 and the device that has the ID 209846738.
PS C:\> Remove-CMUserAffinityFromDevice -DeviceId "209846738" -UserId "206359374"