Import-SCSMInstance
Import-SCSMInstance
Imports objects and relationships from a comma-separated value (CSV) data file.
Syntax
Parameter Set: Default
Import-SCSMInstance -DataFileName <String> -FormatFileName <String> [-BatchSize <Int32> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [ <CommonParameters>]
Detailed Description
The Import-SCSMInstance cmdlet imports objects and relationships 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 object or projection instances that will be committed on each database write. If specified, this parameter must be an integer value between 1 and 5000. The default value is 50.
Parameters
-BatchSize<Int32>
Specifies the number of object or projection instances that will be committed on each database write. This value must be between 1 and 5000. The default value is 50.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
50 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ComputerName<String>
Specifies the name of the computer on which the Service Manager SDK Service is running. The default value is "localhost". The user account that is defined in the Credential parameter must have access rights to the specified computer.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Credential<PSCredential>
Specifies the credentials to use when you connect to the server on which the Service Manager SDK Service is running. The provided user account must have access to that server. The default value for this parameter is the user account of the current context.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DataFileName<String>
The file path of the CSV file that contains the instance data.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-FormatFileName<String>
The file path of the XML format file that describes the instance data.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
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
Examples
-------------------------- EXAMPLE 1 --------------------------
Description
-----------
This command imports the computer projections in computers.csv, 100 rows at a time.
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
...
C:\PS>Import-SCSMInstance -FormatFileName computers.xml -DataFileName computers.csv -BatchSize 100
Related topics
Getting Started with Service Manager Cmdlets for Windows PowerShell