Import-CMUserDeviceAffinity

Imports a file that contains user and device affinities to Configuration Manager.

Syntax

Import-CMUserDeviceAffinity
      [-EnableColumnHeading <Boolean>]
      -FileName <String>
      [-MappingOrder <Mapping[]>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-CMUserDeviceAffinity cmdlet imports a file that contains user and device affinities to Microsoft System Center Configuration Manager. User device affinity in System Center Configuration Manager is a method of associating a user with one or more specified devices.

The devices listed in the file that you specify in the FileName parameter must already exist as resources in the Configuration Manager database. If they do not exist, the import will fail.

Examples

Example 1: Import a user device affinity

PS C:\>Import-CMUserDeviceAffinity -FileName "Remote_Users.csv" -EnableColumnHeadings $True

This command imports the user device affinity in the file named Remote_Users.csv. The EnableColumnHeadings parameter specifies that the import file has column headings for reference purposes.

Required Parameters

-FileName

Specifies a .csv file that contains a list of users and devices you want to create an affinity between. Each user and device pair must be on a separate line separated by a comma. Use the format <Domain>\<user name>,<device NetBIOS name>.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-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
-EnableColumnHeading
Type:Boolean
Aliases:EnableColumnHeadings
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
-MappingOrder
Type:Mapping[]
Aliases:MappingOrders
Parameter Sets:Users, Devices, Ignored
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False