This is the second part of the blog series about my Asset Management solution for SCSM 2012 R2.
This part of the series covers the classes and relationships created with Visual Studio 2015 Community Edition (incl. VSAE).
The solution has two base classes
- AssetManagementBaseClass (DisplayName: Asset)
The AssetID is automatically filled and auto-increments.
Some fields reference lists (EnumType), so that the user can select the entries from predefined values.
- OrderBaseClass (DisplayName: Order)
Four sub-classes (based on AssetManagementBaseClass):
- ComputerAsset (DisplayName: Computer Asset)
- Peripheral (DisplayName: Peripheral)
- ServerInfrastructureAsset (DisplayName: Server Infrastructure Asset)
- NetworkInfrastructureAsset (DisplayName: Network Infrastructure Asset)
ServerInfrastructureAsset and NetworkInfrastructureAsset are similar to Peripheral, that is the reason why I did not add a picture. Because of the inheritance the sub-classes get all properties from the AssetManagementBaseClass.
And 8 Groups to be able to give permissions to these objects. They all look like this:
There are separated Groups for Assets, Computer Assets, Peripherals, NetworkInfrastructureAssets, ServerInfrastructureAssets, Orders, Windows Computers and AD Users.
Each group needs to be discovered. So the solution also has 8 discoveries like this:
Each property which should use a list needs an enumtype defined. I also created three additional entries for the AssetStatus list
Categories need to be defined, to be able to see and edit the lists in the console.
The Category Category.ManagementPackName is required to define that this a SCSM Management Pack:
Here is an example how the other categories look like:
The categories with Value=”System!VisibleToUser” enables the user to view the list in the list view.
The categories with the Value=”Authoring!Microsoft.EnterpriseManagement.ServiceManager.UI.Authoring.EnumerationViewTasks
lets the edit task appear in the list view.
Relationships are required to be able to reference the different class objects with each other. All relationships are from the type System.Reference.
- Asset To Order Relationship:
- Asset To Custodian Relationship:
With that an AD User can be linked to the Asset as Custodian.
- Asset To Computer Asset Relationship:
The same type of relationship is also created for Asset To Peripheral, Asset To NetworkInfrastructureAsset and Asset To ServerInfrastructureAsset.
Remember these relationships as you need to create them when you want to view fields from different related classes in the same view/form. This means when an ComputerAsset object gets created then you also need to create relationship object for the AssetToComputerAsset relationship. Otherwise you cannot show field values from both classes in the same view/form.
You can also create new classes i.e. for mobile devices or software assets. Use these classes here as an example and create all required objects (EnumTypes, Groups, Discoveries, Relationships, Categories).
Here are some additional links: