Importing data into SCSM (part4) – The manual & CSV import CI creation

December 16, 2009 at 2:46 pm in Uncategorized by kurtvh

To make the “Importing data into SCSM” blog list complete we also have to provide information about the manual and CSV file import. Previous blog posts have listed the “automated” ways to import CI’s in SCSM from AD, SCCM & SCOM. AD is a source for CI’s that in most cases can be used. SCCM and SCOM add information to existing CI’s and both create new CI’s who are not available in SCSM. In cases where both System Center products are not available, a manual or CVS import can be used for adding CI’s in SCSM.

Manual creation of CI’s:

Computers, printer, Users & Services can be imported via the manual way. (Default mgmt. console folders – other items can be imported and made visible via SCSM View’s.

In brief, the manual procedure (As example, a computer CI is added)

1. In the Service Manager console, select Configuration Items.

2. In the Configuration Items pane, expand Configuration Items, and then expand Computers. In order to create a new printer, User or service, select the appropriate folder.

3. Select All Computers, and then in the Tasks pane, under Computers, click Create Computer.

4. In the form that appears, create a configuration item for a computer. Use the General, Software and Related Items tabs to fill in the information about the computer.

image     

5. Click OK to save the new configuration item.

For your information, some form screenshots of the creation of the other CI’s.

Note: Not all fields can be provided with data via the CSV file import. In certain cases it is mandatory to have SCCM or SCOM to add the required data.

  • Form for new printer CI’s

image   

  • Form for New service CI’s

image        

  • Form for New User CI’s

image

CSV import

Configuration items contained in a comma-separated values (CSV) file can be imported into the Service Manager database by using the Import from CSV file feature. This feature allows you to bulk-import instances of any class type or projection type that is defined in the Service Manager database. This feature can be used to:

  • Create Configuration Item or Work Item instances from data stored in a tabular format.
  • Bulk-edit existing database instances.
  • Populate the Service Manager database with data exported from an external database.
  • Circumvent data entry through forms when many class instances must be created at once.

Two files are required to import a set of instances by using the CSV import feature:

  • A data file that consists of a series of comma-delimited object instances. The data file must end with the ".csv" file name extension.
  • A format file that specifies the class type or projection type of the instances present in the data file. Every instance in the data file is assumed to be of this type. The format file also specifies
    • The subset of properties (and in the case of projections, components) being imported for the indicated type.
    • The order in which those properties appear (as columns) in the associated data file. The format file must have the same file name as the "csv" file that it describes, and it must end with the ".xml" file name extension.

Note: For more information about CSV import and class type or projection types, see the blog post Using the CSV import feature (http://go.microsoft.com/fwlink/?LinkId=159957) and download the file CSVImport.docx. Very good explanation about the topic…

The creation of the CSV data file

To use the CSV Importer, we first need to save the spreadsheet as a “.csv” file. The first row of the spreadsheet is assumed to contain an object instance (and not a header), so we remove this line and save the spreadsheet in a file named "import.csv".

Example of a csv file

image

Creating the format file

The data file “import.csv” is now created. Next step is the creation of a format file that is suitable for importing the rows contained in the import.csv file. The first step in writing the format file is identifying the class type or projection type to be used for the instances in the CSV file.

Microsoft.Windows.Computer is the most appropriate choice for the object type and property set that we wish to import. We begin by declaring the class of the object being imported:

<CSVImportFormat>

<Class Type="Microsoft.Windows.Computer">

</Class>

</CSVImportFormat>

In our example the format file should look like this:

image

When these files are created, we can import this information into SCSM.

Import of the data in SCSM

With the format and data files prepared, we are ready to use the CSV Import task.

1. To access it, navigate to the Administration page in SCSM console

2. Click on the Connectors folder and select the Import from CSV file… task

image

3. On the Import Instances from CSV file page, provide the path to the xml format file and the actual CSV file.

image

4. Click Import to start the creation of the CI’s in SCSM.

5. After the import a summary page is provided with the results of the import.

6. All done…imported items should be visible in the Configuration items page in SCSM (corresponding folders)

Update of a CI via CSV

The update of a CI in SCSM goes in a similar way. Creation of the CSV file with a correct format file is required. When we re-use the example from above, the CSV and format files need to be updated with the additional information.

For example, we add the required Properties.

image

FYI: List of possible Property ID’s for the Microsoft.Windows.Computer class

image

After the update on the format file we need to add the proper information in the CSV file.

image

Import the CSV file and job done!

Enjoy,

Kurt Van Hoecke

http://www.linkedin.com/in/bunkco

Part 1: (Importing data into SCSM (part 1) – the SCSM AD & SCCM connectors)

Part 2: (Importing data into SCSM (part2) – the SCSM OpsMgr Alert connector)

Part 3: (Importing data into SCSM (part3) – the SCSM OpsMgr CI connector)

Digg thisTweet about this on TwitterShare on LinkedInShare on Facebook