Tutorials for Module “CMDB”

In this article:

Creating Your First CMDB Class

For full reference see CMDB2SCCM.

Note

You have to be able to “Edit Settings”.

  1. Go to the tab “Settings”
  2. Navigate to CMDB and click on the plus button at the bottom
../../_images/Tutorial_FirstCMDBClass_1.png
  1. Create a new CMDB class called “Computers”:
../../_images/Tutorial_FirstCMDBClass_2.png

3.1. Field Automation is used for automatic triggering of MSSQL Scripts (e.g. Stored Procedures) or external processes (e.g Powershell Scripts). See example:

<trigger>
   <afterUpdate field="" value="" 
      command=" exec sp_MyStoredProcedure @Id='{Id}' " 
   />
   <afterUpdate field="" value="" 
      title="createTicketAuto" 
      script="C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" 
      arguments="C:\SilverMonkey\v5\Scripts\MyTriggerScript.ps1 -Id {Id}" 
      condition="{SysStatus} = A0.1 - Request" 
      restart="false" 
      back="true" 
   />
</trigger>
  1. Create your first attributes and name them “Name” and “MACAddress”:
../../_images/Tutorial_FirstCMDBClass_3.png ../../_images/Tutorial_FirstCMDBClass_4.png
  1. Create an attribute of the type “Object reference” and set the reference to another custom CMDB Class “Packaging Languages” (It will be good practice for the subsequent tutorial):
../../_images/Tutorial_FirstCMDBClass_5.png ../../_images/Tutorial_FirstCMDBClass_6.png

The Language class is set up as follows:

../../_images/Tutorial_FirstCMDBClass_6_languageclass.png
  1. Set up naming rule

The setting name rule defines how the internal database column SysDisplayName is set. It contains important single column popups like the object reference chooser.

../../_images/Tutorial_FirstCMDBClass_6_namerule.png
  1. Create a list view

Note

There are two different types of views. One is called “List” and the other one is called “Forms”. Lists display multiple elements of a CMDB Class. When clicking on an item, the configured form will be opened to view or edit the item.

../../_images/Tutorial_FirstCMDBClass_7.png

Configure the list as shown:

../../_images/Tutorial_FirstCMDBClass_8.png

Note

  • The setting detailView="Computers Details" will expect a form view with the name “Computers Details”
  • The setting cmdb2sccm="true" displays a transfer button in the list context menu
../../_images/Tutorial_FirstCMDBClass_8_preview.png
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0"?>
<views>
  <view 
  splitterWidth="550" 
  detailView="Computers Details" 
  newLink="" 
  viewPane="true" 
  refresh="false" 
  excelExport="true" 
  importExport="false" 
  cmdb2sccm="true">
    <columns>
      <column field="Name" width="200"/>
      <column field="MACAddress" width="-1"/>
    </columns>
    <data>
      <condition>{search}='' OR Name like {search}</condition>
    </data>
  </view>
</views>
  1. Create a form view

Create a new form view as shown below (you have to stick to the configured name from the list view detailView="Computers Details"):

../../_images/Tutorial_FirstCMDBClass_9.png

A set of attributes and form elements are automatically suggested. You can delete the <connections link="true" /> line as no connections are configured in this example.

../../_images/Tutorial_FirstCMDBClass_10.png

Add an action called “CMDB2SCCM” to the form. The final result of the form looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<views>

<view actions='true'>
<controls>
<CMDB2SCCM   
    title="Transfer Computer to SCCM" 
    param="SingleTransfer"
    restart="true"
  />
     <headline text="Computers" />
     <attribute field="Name" />
     <attribute field="MACAddress" />
     <attribute field="Language" />
     <save delete="true" />
</controls>
</view>

</views>

When you go to CMDB you can have a look at the result of our list and form:

../../_images/Tutorial_FirstCMDBClass_11.png

You can add more attributes to the class and use those attributes in lists and forms as you need.

Setting up Mass Import for ConfigMgr

For full reference see CMDB2SCCM.

Note

This tutorial is built up on the database schema of the tutorial Creating Your First CMDB Class.

You have to get the following information to built up an import for SCCM:

  • SCCM collection names the computer has to be member of
  • Needed computer variable names and accepted values
  • Knowledge of the SIM database schema
  1. Follow the manuall ” Creating Your First CMDB Class
  2. Follow the ” SCCM Transfer
  3. Create a dummy computer and click on “Transfer computer to SCCM”
../../_images/Tutorial_MassImport_01.png
  1. First, select “Rollout unit” (usually, rollout units only make sense when importing multiple computers; the example below is simplyfied) and click on execute
../../_images/Tutorial_MassImport_02.png
  1. When the action is performed in SQL level the following results will be translated by the mass import feature:
  • Computer Query
  • Package Query
  • Application Query
  • Variable Query
../../_images/Tutorial_MassImport_02_interalquery.png
  1. The result in SCCM looks like the following:

Variables:

../../_images/Tutorial_MassImport_03.png

Primary Users:

../../_images/Tutorial_MassImport_04.png

Collection membership:

../../_images/Tutorial_MassImport_05.png