Remove-CMDeviceAffinityFromUser
Removes device affinity from a Configuration Manager user.
Syntax
Remove-CMDeviceAffinityFromUser
[-DeviceId <Int32[]>]
[-DeviceName <String[]>]
[-Force]
-UserName <String[]>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMDeviceAffinityFromUser
[-DeviceId <Int32[]>]
[-DeviceName <String[]>]
[-Force]
-UserId <Int32>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-CMDeviceAffinityFromUser cmdlet removes device affinity from a user of 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.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Remove device affinity from a user by user ID
PS XYZ:\> Remove-CMDeviceAffinityFromUser -UserName "Patti Fuller" -DeviceName "WestDivUpdates05"
This command adds affinity to the device named WestDivUpdates05 for the user named Patti Fuller.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeviceId
Specifies a device by using an ID.
Type: | Int32[] |
Aliases: | DeviceIds |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeviceName
Specifies a device by using a name.
Type: | String[] |
Aliases: | DeviceNames |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Run the command without asking for confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserId
Specifies a user by using an ID.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserName
Specifies an array of user names.
Type: | String[] |
Aliases: | UniqueUserName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
System.Object