Import-SCSMInstance

Imports objects and relationships from a .csv file into Service Manager.

Syntax

Import-SCSMInstance [-BatchSize <Int32>] [-ComputerName <String[]>] [-Confirm] [-Credential <PSCredential>]
 -DataFileName <String> -FormatFileName <String> [-SCSession <Connection[]>] [-WhatIf] [<CommonParameters>]

Description

The Import-SCSMInstance cmdlet imports objects and relationships from a comma-separated value (.csv) file into Service Manager.

Two parameters must be set to import instances in bulk into Service Manager:

- DataFileName, which must contain the file path of a .csv file that contains the instance data.

  • FormatFileName, which must contain the file path of an .xml file that defines the format of the .csv file.

    The optional BatchSize parameter specifies the number of objects or projection instances that will be committed on each database write.

Examples

Example 1: Import computer projections

PS C:\>Import-SCSMInstance -FormatFileName "computers.xml" -DataFileName "computers.csv" -BatchSize 100
Contents of computers.xml
-------------------------

  
    
      
        
        
      
    
    
      
        
          
          
          
        
      
    
  

Contents of computers.csv
-------------------------
false, computer1, 6.1, Windows, 1003
false, computer2, 6.1, Windows, 1003

This command imports computer projections from the file that is named computers.csv. The command imports 100 rows at a time.

Parameters

-BatchSize

Specifies the number of objects or projection instances that this cmdlet commits on each database write. This value must be an integer between 1 and 5000. The default value is 50.

Type:Int32
Required:False
Position:Named
Default value:50
Accept pipeline input:False
Accept wildcard characters:False
-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs. The user account that is specified in the Credential parameter must have access rights to the specified computer.

Type:String[]
Required:False
Position:Named
Default value:Localhost
Accept pipeline input:False
Accept wildcard characters:False
-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
-Credential

Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs. The specified user account must have access rights to that server.

Type:PSCredential
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DataFileName

Specifies the file path of the .csv file that contains the instance data.

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

Specifies the file path of an .xml file in which the format of the .csv file is defined.

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

Specifies an object that represents the session to a Service Manager management server.

Type:Connection[]
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

Inputs

None.

You cannot pipe input to this cmdlet.

Outputs

None.

This cmdlet does not generate any output.