Edit

Share via


Import-CMUserDeviceAffinity

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

Syntax

Default (Default)

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 Configuration Manager. User device affinity in 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.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Import a user device affinity

PS XYZ:\>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.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableColumnHeading

The Import-CMUserDeviceAffinity cmdlet imports a file that contains user and device affinities to Configuration Manager. User device affinity in 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.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:EnableColumnHeadings

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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>.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FilePath, ImportFilePath, Path

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MappingOrder

The Import-CMUserDeviceAffinity cmdlet imports a file that contains user and device affinities to Configuration Manager. User device affinity in 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.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Parameter properties

Type:

Mapping[]

Default value:None
Accepted values:Users, Devices, Ignored
Supports wildcards:False
DontShow:False
Aliases:MappingOrders

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object