Import-CMUserDeviceAffinity
Import-CMUserDeviceAffinity
Imports a file that contains user and device affinities to Configuration Manager.
Syntax
Parameter Set: ImportByFileName
Import-CMUserDeviceAffinity -FileName <String> [-EnableColumnHeadings <Boolean> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Import-CMUserDeviceAffinity cmdlet imports a file that contains user and device affinities to Microsoft System Center 2012 Configuration Manager. User device affinity in System Center 2012 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.
Parameters
-EnableColumnHeadings<Boolean>
Indicates that the import file has column headings for reference purposes. If the comma-separated values file that you specify in the FileName parameter has a header line, specify this parameter and Configuration Manager ignores the header line during the import.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-FileName<String>
Specifies a comma-separated values (.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>.
Aliases |
none |
Required? |
true |
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: Import a user device affinity
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.
PS C:\> Import-CMUserDeviceAffinity -FileName "Remote_Users.csv" -EnableColumnHeadings $True