The RTM version of Service Manager Authoring Tool is released! The new versions allows you to do some new things that we did direct in XML before. In this blog post I will show you how you can create a new CI class, add a custom form to work with your class and also seal your management pack. The first thing you need to do is install the RTM version of the Authoring Tool. You can download it here.
In this example we will build a custom CI class named contoso. The first part will create a new CI class named Contoso.Projector.Library, we will then add a couple of properties that describes a projector.
- Start Service Manager Authoring Tool (v 7.0.5826.620)
- Click “Create a new Management Pack”
- Input Contoso.Projector.Library as file name, click save
- Select the top node in the management pack explorer, in the details pane, input “Management Pack that extends the CMDB with a projector class.” as description
- In the management pack explorer, right-click Classes and select “Create Configuration Item Class…”
- In the create class window, input Contoso.Projector and click Create
- Change the class name and description if needed
- Click “Create Property”
- In the create property window, input for example “Resolution”. Repeat step 9 for each of the following properties
- Select the Name property and change Key to TRUE. This means that the Name property will be the single property identifying a unique instance of the projector class.
- Select the automatically added property named Property_X. Delete it.
- When you select a property you can change details in the details pane. Change the data type for your properties, for example change WarrantyEnd and Purchase to data type Date Time. That means that the data should be in date format.
- Change some of the names to a better display string for example
- Purchase, Purchase date
- Number, Serial Number
- WarrantyEnd, Warranty End
- Monthly, Monthly Price
- Change Name to minimum length 2. You need to input at least two letters
That should do it; the class for projectors is done. Next step is to create a form that we can use to add projectors in the service manager console.
- In management pack explorer, right-click Forms and select Create
- In the base class window, select Contoso.Projector
- In the create form window, input contoso.projector.form
- Drag and drop a label for each property from the form customization toolbox to the form design window
- Drag and drop a text box for each property where the user will input text strings
- Drag and drop a date picker for the purchase date and warranty end date properties
- In the detail pane you can change the font and text size for any text
- The next step is to bind each text box to a property of your project class. Select a text box, for example Name and click binding path in the details pane.
- In the Binding Path window, select Name
- Repeat step 9 for each text box and date picker
That should do it! You now have a management pack with a new class and a form that we can use to create CIs for the new class.
We should seal the management pack before we import it. That would give us a couple of benefits, for example we can store views and folders in another management pack and access objects related to our projects management pack. We can’t create views and folders in the current version of the authoring tool so good practices could be to save them in another unsealed management pack and all core things in a sealed library management pack.
Next step is to seal the management pack. To seal the MP we will use .NET framework strong name utility (sn.exe).
- Open a command prompt
- Navigate to the folder where SN.EXE is located, in my case C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\bin\.
- Run SN –k mykey.snk
- Verify that a new key pair was generated, for example a mykey.snk file
- Switch to the Authoring Tool again
- In the management pack explorer, right-click the top node, in my example Contoso.Projector.Library and select “Seal Management Pack”
- In the Seal Management Pack window, select a suitable Output Folder, for example C:\MPs
- Browse and select your key file that you generated in step 3
- Input a company name, for example Contoso
- Click Seal
- Verify that seal succeeded, click Close
Now, import your management pack into Service Manager. Remember to import the management pack from C:\MPs, your sealed version. To create and view projectors you need to create a folder and a view
- In the service manager console, go to the Configuration Items workspace
- In the tasks pane, click Create Folder
- In create new folder window, input Projectors as Folder Name. Create a new management pack named Contoso.projector.config and store the folder in it. We can’t store the folder in your Contoso.projector.library management pack as it is now sealed.
- Select your new Projectors folder and select Create View
- In the create view window, input “All projectors” and view name. In the Criteria tab select Contoso.Projector as class. Click OK to save the view.
- Select your new “All projects” view. Create “create contoso.projector” from the tasks pane. Contoso.Projector is the name of the class we created in the authoring tool.
- In the projector form, fill in the text fields and click OK
Now you have a new class in your CMDB, you can store information about projectors. You can use your new form to input the information and your new view to review it.