Import-CMUserDeviceAffinity

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

Syntax

Import-CMUserDeviceAffinity
      [-Confirm]
      [-DisableWildcardHandling]
      [-EnableColumnHeading <Boolean>]
      -FileName <String>
      [-ForceWildcardHandling]
      [-MappingOrders <Mapping[]>]
      [-WhatIf]
      [<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
Required:True
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableColumnHeading
Type:Boolean
Aliases:EnableColumnHeadings
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

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