Import-SCSMInstance
Imports objects and relationships from a comma-separated value (.csv) file into Service Manager.
Import-SCSMInstance
-FormatFileName <String>
-DataFileName <String>
[-BatchSize <Int32>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
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. If specified, the value of this parameter must be an integer between 1 and 5000. The default value is 50.
PS C:\>Import-SCSMInstance -FormatFileName "computers.xml" -DataFileName "computers.csv" -BatchSize 100
Contents of computers.xml
-------------------------
<CSVImportFormat>
<Projection Type="Microsoft.Windows.Computer.ProjectionType">
<Seed>
<Class Type="Microsoft.Windows.Server.Computer">
<Property ID="IsVirtualNode"/>
<Property ID="PrincipalName"/>
</Class>
</Seed>
<Component Alias="OperatingSystem">
<Seed>
<Class Type="Microsoft.Windows.OperatingSystem">
<Property ID="OSVersion"/>
<Property ID="ProductType"/>
<Property ID="BuildNumber"/>
</Class>
</Seed>
</Component>
</Projection>
</CSVImportFormat>
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.
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: | System.Int32 |
Position: | Named |
Default value: | 50 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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: | System.String[] |
Position: | Named |
Default value: | Localhost |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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: | System.Management.Automation.PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the file path of the .csv file that contains the instance data.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the file path of an .xml file in which the format of the .csv file is defined.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies an object that represents the session to a Service Manager management server.
Type: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
None.
You cannot pipe input to this cmdlet.
None.
This cmdlet does not generate any output.