Import-CMComputerInformation

Imports computer information into a Configuration Manager database.

Syntax

Import-CMComputerInformation
      [-CollectionId <String[]>]
      [-CollectionName <String[]>]
      -ComputerName <String>
      [-InputObject <IResultObject[]>]
      [-MacAddress <String>]
      [-MergeIfExist]
      [-SMBiosGuid <String>]
      [-SourceComputerName <String>]
      [-UserAccountMigrationBehavior <MigrationBehavior>]
      [-UserName <String[]>]
      [-WindowsToGoUniqueKey <String>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-CMComputerInformation
      [-CollectionId <String[]>]
      [-CollectionName <String[]>]
      [-EnableColumnHeading <Boolean>]
      -FileName <String>
      [-InputObject <IResultObject[]>]
      [-VariableName <String>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-CMComputerInformation cmdlet imports computer information directly into a Configuration Manager database. For Configuration Manager to deploy an operating system to a new computer with no installed operating system, you must add the new computer to Configuration Manager. After you import the computer information, Configuration Manager can deploy an operating system.

You can import a single computer by specifying the Media Access Control (MAC) address and computer name, along with the name of a collection. This cmdlet adds this computer to the specified collection.

You can also import several computers by specifying a Comma Separated Values .csv file with computer information, along with the name of a collection. This cmdlet adds the computers to the specified collection.

You can specify the name of a reference computer. Configuration Manager migrates user information and settings from the reference computer to the new computer.

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 computers by using a file

PS XYZ:\>Import-CMComputerInformation -CollectionName "All Systems" -FileName "\\cmshare\Public\CM\ImportComputers.csv" -EnableColumnHeading $True

This command imports the computers specified in the CSV file into the All Systems collection. This command includes a value of $True for the -EnableColumnHeading parameter. The cmdlet ignores the first line of the file.

Example 2: Import a single computer

PS XYZ:\>Import-CMComputerInformation -CollectionName "All Systems" -ComputerName "Computer08" -MacAddress "5F:DA:FA:FA:FA:FA" -SmBiosGuid "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"

This command imports a specified computer into the All Systems collection. The command specifies the name, MAC address, and SMBIOS GUID for a computer.

Example 3: Import a computer using a reference computer

PS XYZ:\>Import-CMComputerInformation -CollectionName "All Systems" -ComputerName "Computer08" -MacAddress "5F:DA:FA:FA:FA:FA" -SmBiosGuid "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" -SourceComputerName "ResourceComputer01"

This command imports a specified computer into the All Systems collection. The command specifies the name, MAC address, and SMBIOS GUID for a computer. The command also includes a reference computer to associate with the new computer.

Parameters

-CollectionId

Type:String[]
Aliases:CollectionIds
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CollectionName

Specifies a name of a Configuration Manager device collection.

Type:String[]
Aliases:CollectionNames
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies the name of a computer that this cmdlet imports information from.

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

-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

-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

-EnableColumnHeading

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

-FileName

Specifies a .csv file that contains computer information. The file must contain the name and MAC address of each computer to be imported.

Type:String
Aliases:FilePath, ImportFilePath, Path
Position:Named
Default value:None
Required:True
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

-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

Type:IResultObject[]
Aliases:Collection, Collections
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-MacAddress

Specifies a MAC address for a computer in the format (00:00:00:00:00:00). The Windows Preinstallation Environment (Windows PE) must have a driver for the specified network adapter.

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

-MergeIfExist

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

-SMBiosGuid

Specifies a GUID for the system management BIOS (SMBIOS) of a computer.

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

-SourceComputerName

Specifies a name of a reference computer. Configuration Manager migrates user state and settings from the reference computer to the new computer.

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

-UserAccountMigrationBehavior

Type:MigrationBehavior
Accepted values:CaptureAllUserAccountsAndRestoreSpecifiedAccounts, CaptureAndRestoreSpecifiedUserAccounts
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserName

Type:String[]
Aliases:UserNames
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VariableName

Specifies a variable name for an imported column. When you import a .csv file, you specify the columns to import and assign them to a Configuration Manager field. A variable allows you to assign a column to a variable.

Type:String
Position:Named
Default value:None
Required:False
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

-WindowsToGoUniqueKey

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject[]

Outputs

System.Object