A knowledge article contains custom information aimed at helping a user of the Operations Manager Operations Console or the Web Console. Knowledge articles are added to a Management Pack, or an element of a Management pack such as a monitor, a discovery object, or a rule, by using the Microsoft.EnterpriseManagement.Configuration.ManagementPackKnowledgeArticle class. The knowledge article is written in HTML, and it can contain specific information about the element or Management Pack that it is associated with.

The following code example creates a knowledge article for a rule.

Visual Basic  Copy Code
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.EnterpriseManagement
Imports Microsoft.EnterpriseManagement.Configuration
Imports System.Collections.ObjectModel

Namespace SDKSamples
	Class Program

		Public Overloads Shared Function Main(ByVal args() As String) As Integer

			Dim mg As New ManagementGroup("localhost")
			Dim defaultMP As ManagementPack = mg.GetManagementPacks("Microsoft.SystemCenter.OperationsManager.DefaultUser")(0)

			Dim ruleCriteria As New MonitoringRuleCriteria("DisplayName = 'SQL User Connections'")

			Dim rule As MonitoringRule = Nothing
				rule = mg.GetMonitoringRules(ruleCriteria)(0)
			Catch e As System.ArgumentOutOfRangeException

				Console.WriteLine("Error: Could not retrieve the specified rule.")
				Return 1
			End Try

			Dim article As New ManagementPackKnowledgeArticle(rule, "ENU", defaultMP)
			article.HtmlContent = "<html><body>This is a placeholder for a knowledge article</body></html>"

		End Function 'Main
	End Class 'Program
End Namespace 'SDKSamples
C#  Copy Code
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using System.Collections.ObjectModel;

namespace SDKSamples
	class Program
		static void Main(string[] args)
			ManagementGroup mg = new ManagementGroup("localhost");
			ManagementPack defaultMP = mg.GetManagementPacks(

			MonitoringRuleCriteria ruleCriteria = 
				new MonitoringRuleCriteria("DisplayName = 'SQL User Connections'");

			MonitoringRule rule = null;
				rule = mg.GetMonitoringRules(ruleCriteria)[0];
			catch (ArgumentOutOfRangeException)
				Console.WriteLine("Error: Could not retrieve the specified rule.");
			ManagementPackKnowledgeArticle article = 
				new ManagementPackKnowledgeArticle(rule, "ENU", defaultMP);
			article.HtmlContent = 
				"<html><body>This is a placeholder for a knowledge article</body></html>";


Send comments about this topic to Microsoft.