<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>System Center Operations Manager</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/tysonpaul/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/tysonpaul/feed.xml</link>
    <description>Tasty Treats for System Center Operations Manager (by Tyson Paul)</description>
    <lastBuildDate>Thu, 20 Jun 2019 06:02:44 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>This will be my last post here</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/this-will-be-my-last-post-here</link>
      <pubDate>Wed, 19 Jun 2019 23:59:34 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=4305</guid>
      <description><![CDATA[2019/06/20

This will be my last post here (MSDN). I won't have access to post/edit this blogging...]]></description>
      <content:encoded><![CDATA[2019/06/20

This will be my last post here (MSDN). I won't have access to post/edit this blogging platform after today. I can't say for certain if I will continue to blog elsewhere at Microsoft or perhaps on my own private host in the future. I'd like to expand topics beyond SCOM and PowerShell. If I do, I'll see about moving this content to a new site. Thanks for all of your kind comments and feedback over the past few years. I truly enjoy making the world a little bit easier to live in by providing these tips, tricks, and tools.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>How to Analyze a SCOM Property Bag</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/how-to-analyze-a-scom-property-bag</link>
      <pubDate>Thu, 30 Aug 2018 22:28:14 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=3985</guid>
      <description><![CDATA[From time to time I find myself writing PowerShell scripts for custom workflows: discoveries, rules,...]]></description>
      <content:encoded><![CDATA[From time to time I find myself writing PowerShell scripts for custom workflows: discoveries, rules, monitors, tasks, etc. Often times the project at hand requires a property bag full of juicy data to be used in the workflow. There are a handful of other blogs that describe what a property bag is but here I’ll show you how to make your property bag experience just a bit easier.

When you want to harvest data with a PowerShell script and then return that data to the workflow (to be used any number of ways ) name value pairs get returned in what is called a property bag. A property bag is simply XML structure that looks like this:

<span style="font-size: small">&lt;DataItem type="System.PropertyBagData" time="2018-08-30T20:33:12.2154943-06:00" sourceHealthServiceId="c0c09ff6-3834-fc37-4bb9-1633c62eda56"&gt;
<span style="font-size: small">   &lt;Property Name="Fingers" VariantType="3"&gt;10&lt;/Property&gt;
<span style="font-size: small"><span style="font-size: small">   &lt;Property Name=”Toes” VariantType="3"&gt;10&lt;/Property&gt;
<span style="font-size: small">   &lt;Property Name="Eyes" VariantType="3"&gt;2&lt;/Property&gt;
<span style="font-size: small">&lt;/DataItem&gt;</span></span></span></span></span></span>

The XML dataitem includes the following information:
<ul>
 	<li> This is a property bag.</li>
 	<li> A timestamp indicating when it was submitted to the management server.</li>
 	<li> The name/value pairs contained in the property bag.</li>
</ul>
The <strong>VariantType</strong> describes the type of the value that is returned. The typical variant types are:

0 = Empty
1 = Null
2 = Short
3 = Integer
4 = Single
5 = Double
6 = Currency
7 = Date
8 = String
9 = Object
10 = Error
11 = Boolean
12 = Variant
13 = DataObject
14 = Decimal
15 = Byte
16 = Char
17 = Long

The property bag is a pretty simple animal but sometimes it can produce unexpected results. When that happens it helps to be able to see what the property bag contains when testing your script. Here’s a sample script which creates a property bag and displays the dataitem to the screen:

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #008800;font-style: italic">#Script: Test.ps1</span>

<span style="color: #008800;font-style: italic"># Here we create the com object</span>
$api = new-object -comObject <span style="color: #0000ff">'MOM.ScriptAPI'</span>
<span style="color: #008800;font-style: italic"># From the com object we spawn the bag. Now we can stuff things into the bag.</span>
$bag = $api.CreatePropertyBag()

<span style="color: #008800;font-style: italic"># Here I've added an assortment of different type things to the bag. </span>
<span style="color: #008800;font-style: italic"># They each have a name and a value.</span>
$bag.AddValue(<span style="color: #0000ff">'ONE'</span>,[string]<span style="color: #0000ff">"My String"</span> )
$bag.AddValue(<span style="color: #0000ff">'TWO'</span>,[Decimal]9876543210987654321)
$bag.AddValue(<span style="color: #0000ff">'THREE'</span>,[double]987654321 )
$bag.AddValue(<span style="color: #0000ff">'FOUR'</span>,[int]4444 )
$bag.AddValue(<span style="color: #0000ff">'FIVE'</span>,[float]55.66 )
$bag.AddValue(<span style="color: #0000ff">'SIX'</span>,[byte]56 )
$bag.AddValue(<span style="color: #0000ff">'SEVEN'</span>,[datetime]<span style="color: #0000ff">"03/04/2012"</span> )
$bag.AddValue(<span style="color: #0000ff">'EIGHT'</span>,[long]987654321 )
$bag.AddValue(<span style="color: #0000ff">'NINE'</span>, $null )

<span style="color: #008800;font-style: italic"># Here is how I would ordinarily return the bag so </span>
<span style="color: #008800;font-style: italic"># that the SCOM workflow can use the contents of the bag.</span>
$bag

<span style="color: #008800;font-style: italic"># Here is how I can display the contents of the bag to the screen. This is </span>
<span style="color: #008800;font-style: italic"># useful only when testing the script manually.</span>
$api.<span style="color: #000080;font-weight: bold">Return</span>($bag)
</pre>
</div>
&nbsp;

Run the script from an ordinary PowerShell console (not ISE):

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag1.jpg"><img width="770" height="259" title="AnalyzeaSCOMPropertyBag1" alt="AnalyzeaSCOMPropertyBag1" src="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag1_thumb.jpg" border="0" /></a>

It’s pretty easy to get the data to display on the screen but it’s a messy blob of confusing text. This example is small. Imagine if you had dozens or hundreds of name/value pairs in your bag. It would be a nightmare to comb through all of it. You could copy/paste the text from the console into a text editor and try to reconstruct all of the broken lines but that’s an awful waste of time.

<strong>Solution</strong>: Output that data to a text file and format it easily with <strong>Notepad++</strong>. (NPP can be found easily with a quick search of the innerwebs. Yes, innerwebs.)

Output the property bag to an .xml file. This is easy with the redirection operator:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag2.jpg"><img width="855" height="181" title="AnalyzeaSCOMPropertyBag2" alt="AnalyzeaSCOMPropertyBag2" src="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag2_thumb.jpg" border="0" /></a>

&nbsp;

Open the file with <strong>Notepad++. </strong>The file is still ugly. Let’s fix that.

<strong>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag3.jpg"><img width="855" height="589" title="AnalyzeaSCOMPropertyBag3" alt="AnalyzeaSCOMPropertyBag3" src="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag3_thumb.jpg" border="0" /></a></strong>

&nbsp;

Format the data with the XML Tools plugin:
<span style="font-size: xx-small"><strong>Note</strong>: You may have to manually add the “Plugin Manager”. This is pretty easy. It involves extracting a few DLLs into the Notepad++ Plugins directory. Once Plugin Manger is available, you can add tons of plugins with a few clicks, including XML Tools. There’s a blurb about it <a target="_blank" href="https://notepad-plus-plus.org/community/topic/14496/no-plugin-manager" rel="noopener">here</a>.</span>

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag4.jpg"><img width="855" height="717" title="AnalyzeaSCOMPropertyBag4" alt="AnalyzeaSCOMPropertyBag4" src="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag4_thumb.jpg" border="0" /></a>

&nbsp;

Easy!

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag5.jpg"><img width="855" height="409" title="AnalyzeaSCOMPropertyBag5" alt="AnalyzeaSCOMPropertyBag5" src="https://msdnshared.blob.core.windows.net/media/2018/08/AnalyzeaSCOMPropertyBag5_thumb.jpg" border="0" /></a>

Note: Line 1 is a result of the script statement:
<span style="color: #0000ff">$bag</span>

Lines 2 – 12 are a result of the script statement:
<span style="color: #0000ff">$api.Return($bag)</span>

You'll also notice that in line 10 the variant type is "20". It was cast as a "long" which PowerShell equates to "System.Int64" and I would expect it to end up as VariantType="17".  I don't know what type "20" is and I don't have time to research it. Anyone want to hunt it down? I'm sure it's in some schema doc somewhere. This is an example of getting something unexpected in the property bag.]]></content:encoded>
    </item>
    <item>
      <title>SCOMHelper PowerShell Module - A SCOM Admin’s Best Friend</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/scomhelper-powershell-module-a-scom-admins-best-friend</link>
      <pubDate>Mon, 06 Aug 2018 04:00:23 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=3495</guid>
      <description><![CDATA[*Note: after today (2019/06/19) I will no longer have access to update this blog. Check the...]]></description>
      <content:encoded><![CDATA[*Note: after today (2019/06/19) I will no longer have access to update this blog. Check the PowerShell gallery (<a target="_blank" href="https://www.powershellgallery.com/packages?q=scomhelper" rel="noopener">PSGallery</a>) for updates.

(installation instructions at bottom)

There are a number of cool scripts that I’ve collected, borrowed, and written in my travels as a SCOM field engineer and PowerShell enthusiast. I decided to put them all together into one module for easier maintenance and use. Enjoy.
<h2>SCOMHelper Module Functions:</h2>
&nbsp;
<h3>New-SCOMClassGraph</h3>
First and foremost my pride and joy is this brilliant work of art. I’m pretty sure I just tweaked my own arm patting myself on the back but you know what, I am really proud of this. This is a first of its kind tool (that I know of) for generating a graphical representation of a SCOM class. It will create a graphical structure (.png) that represents SCOM class taxonomy, all properties, hosting and discovery relationships for a SCOM class.  This function relies on a few other brilliant modules but don’t worry, this function will automate the other module installations for you.  (This is assuming you have connectivity to the interwebs. Yes, interwebs. Otherwise you will have to obtain the dependencies manually.) This tool will prove to be priceless for any SCOM admins, enthusiasts, and most importantly, MP authors, both new and seasoned.
Note: This function requires PowerShell v5 or greater due to some other module dependencies. Tested with SCOM 2019, 2016, 2012 R2.

Feed this function one or more of the following: a class object, class Name, class Display Name, or class ID, and it will do the rest. There are a few neat parameters to control caching of graphics files, include/exclude related class discovery workflows, and displaying the new graph file.

Examples:

Below is an example of class: <em>Microsoft.SQL.Server.2014.DBEngine. </em>The legend is shown on the top right of the graphic to help you understand the relationships between boxes.

The <strong><span style="color: #ff6600">orange</span></strong> boxes represent <em>classes</em> that are HOSTing those connected below it.
The <strong><span style="color: #339966">green</span></strong> boxes are <em>hosted classes</em>, which means they hosted by the <strong><span style="color: #ff6600">orange</span></strong> class box connected above it. (see ‘orange’ definition above).
<strong><span style="color: #ff6600">Orange</span></strong> arrows also help indicate a hosting relationship
The <strong><span style="color: #0000ff">blue</span></strong> boxes represent <em>discoveries</em> which are capable of discovering those classes which are connected (along with the properties listed in blue).
The <span style="color: #cc99ff"><strong>purple</strong></span> boxes represent ordinary abstract classes. Note: other colored boxes may also be abstract.
The <strong>remaining</strong> boxes and arrows represent ordinary class lineage (parent –&gt; child) relationships.
Awesome. I know.
( References: <a target="_blank" href="https://technet.microsoft.com/en-us/library/ee957027.aspx" rel="noopener">Relationships</a>, <a target="_blank" href="https://docs.microsoft.com/en-us/previous-versions/system-center/system-center-2012-R2/hh457568(v=sc.12)" rel="noopener">Understanding Classes and Objects</a>, <a target="_blank" href="https://myinfrastructureblog.wordpress.com/2015/04/23/scom-fundamentals/" rel="noopener">SCOM Fundamentals )</a>

1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">New-SCOMClassGraph</span> -ClassName <span style="color: #aa5500">'Microsoft.SQLServer.Windows.Database'</span>
</pre>
</div>
&nbsp;

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2019/05/Microsoft.SQLServer.Windows.Database.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/05/Microsoft.SQLServer.Windows.Database-999x1024.png" alt="" width="879" height="901" class="alignnone size-large wp-image-4265" /></a><a href="https://msdnshared.blob.core.windows.net/media/2018/08/New-SCOMClassGraph_Microsoft.SQLServer.2014.DBEngine.png"></a>

&nbsp;

&nbsp;

2) This is a much fancier way to accomplish the same thing as Example 1, above, but with the help of GridView to select the class. This command will get all SCOM classes in the management group and select Name, DisplayName, and ManagementPackName to be presented in GridView for easy browsing and selection by the user. Select one or more classes from the Grid View, click OK.  In the example below I’ve filtered on keyword “SQL” and selected a single line item. This selected class name gets piped into the function: <strong>New-SCOMClassGraph</strong>. The resulting graph (.png file) is shown above in Example 1.

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMClass</span> | Select Name,Displayname, <span style="color: #ff0000;background-color: #ffaaaa">@</span>{N=<span style="color: #aa5500">'ManagementPackName'</span><span style="color: #ff0000;background-color: #ffaaaa">;</span>E={<span style="color: #aa0000">$_</span>.Identifier.Domain[0]} }| <span style="color: #00aaaa">Out-GridView</span> -PassThru | <span style="color: #00aaaa">New-SCOMClassGraph</span>
</pre>
</div>
&nbsp;

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/New-SCOMClassGraph_GridviewSelect1.png" rel="noopener"><img width="617" height="478" title="New-SCOMClassGraph_GridviewSelect1" alt="New-SCOMClassGraph_GridviewSelect1" src="https://msdnshared.blob.core.windows.net/media/2018/06/New-SCOMClassGraph_GridviewSelect11.png" border="0" class="" /></a>

The graph file opens with your default ‘.png’ application. Your default viewer might be Internet Explorer, it might be Picture Viewer. You decide. Just be sure to associate .png file type to a default viewer.
You can optionally use the <strong>-ShowGraph:$false</strong>  parameter to prevent the opening of the .png file. You might leverage this feature if you simply wanted to cache all of the files on disk without opening them. I did this in my lab and it took 45 minutes to generate 1688 graphs for a total of 276MB.

&nbsp;

2) This is an example of piping a class object into the cmdlet:

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMClass</span> -Name <span style="color: #aa5500">'Microsoft.SQLServer.2012.Publication'</span> | <span style="color: #00aaaa">New-SCOMClassGraph</span>
</pre>
</div>
&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2019/05/Microsoft.SQLServer.2012.Publication.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/05/Microsoft.SQLServer.2012.Publication-574x1024.png" alt="" width="574" height="1024" class="alignnone size-large wp-image-4285" /></a>
<h3></h3>
You can even display multiple classes on a single graph with the '-Combine' parameter. Show below are two classes on the same graph:
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">Get-SCOMClass -Name 'Microsoft.SQLServer.Windows.ResourcePool','Microsoft.SQLServer.Windows.Database' | New-SCOMClassGraph -Combine
</pre>
</div>
<h3><a href="https://msdnshared.blob.core.windows.net/media/2018/08/MD5Hash_f87c7f9d106912d8adad6f6391487915.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/MD5Hash_f87c7f9d106912d8adad6f6391487915-942x1024.png" alt="" width="879" height="956" class="alignnone size-large wp-image-4295" /></a></h3>
<h3></h3>
&nbsp;

&nbsp;
<h3>Start-SCOMOverrideTool</h3>
This tool is designed to make it easier to manipulate overrides and do a few other admin tasks:
<ul>
 	<li>Bulk enabled/disable workflows for their target class</li>
 	<li>Bulk delete overrides</li>
 	<li>Bulk move overrides between unsealed management packs</li>
 	<li>Remove all obsolete references in all unsealed packs</li>
 	<li>Backup all unsealed management packs</li>
 	<li>Create a new override management pack</li>
</ul>
Ideally normal overrides should be stored in a "buddy pack" directly related to the "base" MP of the affected workflow. (see this article: https://blogs.msdn.microsoft.com/tysonpaul/2016/05/24/how-to-correctly-create-an-override-for-a-scom-workflow/ ) Most of the time it seems that overrides are stored randomly in various unsealed packs with no system of organization. This tool can help get you organize your environment as well as quickly tune workflows in bulk/batches.
<h3><a href="https://msdnshared.blob.core.windows.net/media/2018/08/Start-SCOMOverrideTool_1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/Start-SCOMOverrideTool_1.jpg" alt="" width="735" height="585" class="size-full wp-image-4315 alignnone" /></a></h3>
This tool can enable or disable a workflow by either deleting an existing
override or creating a new override to accomplish the desired effect. (The Enable
and Disable actions only affect the workflow Target class.)
This tool can also move (or relocate) an existing override to a different
unsealed management pack.

This tool doesn't technically "move" the override. It deletes the original
override and creates a new override in the destination MP. Only valid
candidates/overrides will be presented for selection. A valid candidate is
one that does not reference or depend on any other objects (workflows, targets)
contained within the same original unsealed MP.
Example: Overrides that might affect custom groups in the same MP would be ineligible.

For all operations that modify or change any management packs, all activities/actions
are written to the logfile and unsealed packs are backed up prior to any changes.

<strong>For Enable/Disable operation:</strong>
Typically the procedure would be as follows:
1) Select any number of "source" unsealed packs.
Only workflows (Rules/Monitors/Discoveries) from these packs will be presented for selection.
2) Select a "destination" unsealed pack into which to store any *necessary (new) override(s).
3) Select action type: Enable or Disable
4) Select 'type' of workflow(s) you wish to enable/disable: Rule, Monitor, or Override
5) Select any quantity of workflows.
6) Confirm to initiate the enable/disable action

*Note: a) In some cases an override might already exist which must be deleted to result in the
desired effect (enable/disable).
b) Enable/Disable actions only affect the workflow Target class.

<strong>For a "Move" operation: </strong>
Typically the procedure would be as follows:
1) Select any number of "source" unsealed packs from which to select overrides.
2) Select any number of eligible overrides from that set of source packs.
3) Select a "destination" unsealed pack into which to move the override(s).
4) Initiate the move.

You may select one or more 'source' MPs to limit the results shown
during the override selection process. This is effectively a way to
filter the overrides. Otherwise ALL valid overrides from ALL unsealed
MPs will be presented in the selection window. See menu details below.
*This tool does not currently move any overrides related to SecureReference,
Diagnostic, or Recovery objects.

Example: Bulk select workflows to disable:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/Start-SCOMOverrideTool_2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/Start-SCOMOverrideTool_2-1024x422.jpg" alt="" width="879" height="362" class="size-large wp-image-4325 alignnone" /></a>

&nbsp;

&nbsp;
<h3>Show-SCOMPropertyBag</h3>
This nifty function will neatly display your property bags when testing PowerShell scripts.

Ordinarily the property bag output test format would look like this (multiple bag output shown):

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/Show-SCOMPropertyBag_2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/Show-SCOMPropertyBag_2-1024x645.jpg" alt="" width="879" height="554" class="size-large wp-image-4345 alignnone" /></a>

&nbsp;

With this function, they will output like this.

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/Show-SCOMPropertyBag_1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/Show-SCOMPropertyBag_1-1024x722.jpg" alt="" width="879" height="620" class="size-large wp-image-4335 alignnone" /></a>

&nbsp;

In addition, you get a structured PowerShell object to do with as you please.  An example of how to access the PB data in the resulting hash table object:
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #888888"># Store property bag(s) in variable as hash table</span>
<span style="color: #996633">$var</span> = <span style="color: #007020">Show-SCOMPropertyBag</span> -FilePath C<span style="color: #ff0000;background-color: #ffaaaa">:</span>\test\MyTestPB_script.ps1 -Format HashTable

<span style="color: #888888"># Display property bags (basic summary table)</span>
<span style="color: #996633">$var</span>.values

<span style="color: #888888"># Display value in detail example</span>
<span style="color: #996633">$var</span>[1][3].Value
</pre>
</div>
&nbsp;

&nbsp;
<h3>Clear-SCOMCache</h3>
This one’s pretty obvious. Will clear the agent cache and restart the HealthService (Microsoft Monitoring Agent) on the local machine.

&nbsp;
<h3><a id="DisableSCOMAllEventRules"></a>Disable-SCOMAllEventRules</h3>
As you may know, collecting events with SCOM is mostly useless and often times results in performance problems and data bloat in the DBs.  This will disable all event collection rules for the designated sealed management pack(s).

Feed this function one or more sealed management pack objects and it will create a corresponding unsealed pack for each in which it will store overrides which disable <strong>any/all</strong> event collection rules that are currently enabled. The resulting overrides will target the workflow class target.
<strong>Note: This will heavily tax your management server and Operations database during creation of the overrides. </strong>However, once the override files are created, they can be exported and imported wherever they are needed. You might consider running this in your Test environment first, then exporting the override packs to import into your production environment.

Example from my lab machine. The CPU was pegged for a while.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Disable-SCOMEventRules_performance1.jpg" rel="noopener"><img width="670" height="576" title="Disable-SCOMEventRules_performance1" alt="Disable-SCOMEventRules_performance1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Disable-SCOMEventRules_performance11.jpg" border="0" class="" /></a>

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #008800;font-style: italic"># -------------------------- EXAMPLE 1 --------------------------
# Disable all event collections found in the designated MP. Overrides stored in specific override pack. </span>
Disable-SCOMAllEventRules -ManagementPack (Get-SCOMManagementPack -Name <span style="color: #0000ff">'Microsoft.Windows.Server.2012.Monitoring'</span>)


<span style="color: #008800;font-style: italic"># -------------------------- EXAMPLE 2 --------------------------
# Disable all event collections found in the designated MPs. A specific override pack will be created for each base pack. </span>
Disable-SCOMAllEventRules -ManagementPack (Get-SCOMManagementPack -Name  <span style="color: #a61717;background-color: #e3d2d2">@</span>(<span style="color: #0000ff">'Microsoft.SQLServer.2012.Mirroring.Discovery'</span>,<span style="color: #0000ff">'Microsoft.SQLServer.2008.Discovery'</span>) )


<span style="color: #008800;font-style: italic"># -------------------------- EXAMPLE 3 --------------------------</span>
<span style="color: #008800;font-style: italic"># Create an array of MP names. </span>
<span style="color: #a61717;background-color: #e3d2d2">$</span>names=<span style="color: #a61717;background-color: #e3d2d2">@</span><span style="color: #0000ff">"</span>
Microsoft.SystemCenter.<span style="color: #0000ff">2007</span>
Microsoft.Windows.Server.<span style="color: #0000ff">2012.</span>Monitoring
Microsoft.Windows.Server.<span style="color: #0000ff">2012.</span>R2.Monitoring
Microsoft.Windows.Server.AD.<span style="color: #0000ff">2012.</span>R2.Monitoring
Microsoft.SystemCenter.Apm.Infrastructure.Monitoring
Microsoft.SystemCenter.ACS.Internal
Microsoft.Windows.Server.DNS
<span style="color: #0000ff">"@ -split "</span>\n<span style="color: #0000ff">" -replace "</span><span style="color: #a61717;background-color: #e3d2d2">`</span><span style="color: #0000ff">r",""</span>

<span style="color: #008800;font-style: italic"># Retrieve array of management packs then pipe those MPs into the function.
# A specific override pack will be created for each base pack listed above.</span>
Get-SCOMManagementPack -Name <span style="color: #a61717;background-color: #e3d2d2">$</span>names | Disable-SCOMAllEventRules
</pre>
</div>
&nbsp;
<h3>Export-EffectiveMonitoringConfiguration</h3>
The functionality is documented <a target="_blank" href="https://blogs.msdn.microsoft.com/tysonpaul/2018/03/24/scom-export-rules-monitors-overrides-settings-effective-monitoring-configuration-with-powershell/" rel="noopener">here</a> (though I changed the function name slightly in this module).
Will recursively find contained instances of an object (or group of objects) and output the effective monitoring configurations/settings to individual output files. Then it will merge all resulting files into one .csv file, delimited by pipes '|', then output all data to Grid View. In the output directory you will be left with individual configuration files for each object as well as the master merged file containing all object configurations.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig2.jpg" rel="noopener"><img width="449" height="252" src="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig2.jpg" /></a>

&nbsp;
<h3>Export-SCOMEventsToCSV</h3>
This is a quick way to dump events from the Operations Manager event log to a CSV file.

Example:

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Export-SCOMEventsToCSV</span> -Newest 1000 -OutFileCSV <span style="color: #aa5500">'C:\SCOMEvents.csv'</span>
</pre>
</div>
&nbsp;
<h3>Export-SCOMKnowledge</h3>
This is pretty well documented <a target="_blank" href="https://blogs.msdn.microsoft.com/tysonpaul/2017/12/15/export-scom-rule-and-monitor-knowledge-articles-with-powershell/" rel="noopener">here</a>.

This script will get all rule and monitor knowledge article content (with hyperlinks) and output the information to separate files (Rules.html and Monitors.html) in the output folder path specified.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Report1.jpg" rel="noopener"><img width="527" height="251" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Report1.jpg" /></a>

&nbsp;
<h3>Get-SCOMClassInfo</h3>
Will display statistics about the total number of SCOM class instances and the management packs from which they originate.

Examples:

1) Statistics by <strong>class</strong>…

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMClassInfo</span> -Top 10
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Get-SCOMClassInfo_1.jpg" rel="noopener"><img width="550" height="152" title="Get-SCOMClassInfo_1" alt="Get-SCOMClassInfo_1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Get-SCOMClassInfo_11.jpg" border="0" /></a>

2) Statistics by <strong>management pack</strong>…

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMClassInfo</span> -Top 15 -MPStats -ShowGraph
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Get-SCOMClassInfo_mpstats-graph1.jpg" rel="noopener"><img width="549" height="158" title="Get-SCOMClassInfo_mpstats-graph1" alt="Get-SCOMClassInfo_mpstats-graph1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Get-SCOMClassInfo_mpstats-graph11.jpg" border="0" /></a>

&nbsp;
<h3>Get-SCOMHealthCheckOpsConfig</h3>
This will generate an awesome HTML report including many of the popular Health report contents and SQL queries that we all know and love. This was originally written by Tim Culham and then rebooted by MBullwinkle in 2014. It made sense to include it in this module.

<a target="_blank" href="https://blogs.msdn.microsoft.com/tysonpaul/get-scomhealthcheckopsconfig-sample-report/" rel="noopener">Here’s a sample report.</a>

&nbsp;
<h3>Get-SCOMMPFileInfo</h3>
Feed this function a folder path and it will list version and file path information for all management pack files (*.mp, *.mpb, *.xml) in all subdirectories.

If you’re environment is anything like mine, you probably have a spaghetti mess of folders upon folders stuffed with all kinds of management packs that you collected over the years for testing. It’s not always convenient or easy to keep all management packs organized in version-labeled folders. In fact, it’s a huge pain in the neck seeing as how there’s no easy way to determine versioning of MPs based on file properties. This is a friendly tool which will display all of the basic MP info for you.

Example:

1) Feed this function the path to the ‘ManagementPacks’ folder from my SCOM installation media:

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMMPFileInfo</span> -inDir <span style="color: #aa5500">'C:\Temp\en_system_center_2012_r2_operations_manager_x86_and_x64_dvd_2920299\ManagementPacks'</span>
</pre>
</div>
Note: -Passthru is already enabled on the GridView to allow the user to select one or more MP items so they can be piped to another cmdlet that accepts management pack Name, DisplayName, or ID as piped input.

2) This is a super simple way to pick from a list of MPs to import.

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMMPFileInfo</span> -inDir <span style="color: #aa5500">'C:\Temp\MyManagementPacks'</span> | <span style="color: #00aaaa">Import-SCOMManagementPack</span> <span style="color: #ff0000;background-color: #ffaaaa">–</span>Verbose
</pre>
</div>
&nbsp;
<h3>Get-SCOMRunAsAccountName</h3>
Feed this an account SSID and it will return the friendly name of a RunAs account.

When a RunAs account problem occurs the resulting errors will appear in Operations Manager event logs containing the account SSID instead of the friendly ‘Display Name’ which makes it difficult to determine which account is involved. This function will reveal the friendly name of the SSID.

Example:

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMRunAsAccountName</span> -SSID <span style="color: #aa5500">'0000F61CD9E515695ED4A018518C053E3CD87251D500000000000000000000000000000000000000'</span>
</pre>
</div>
&nbsp;
<h3>Get-StringHash</h3>
This isn’t really specific to SCOM but I found it useful in the past so I included it in this module. Feed it an ordinary string (or any object) and it will generate a unique hash value.

Example:

1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-SCOMClass</span> -name <span style="color: #aa5500">'microsoft.windows.server.computer'</span> | <span style="color: #00aaaa">Select-Object</span> -Property Name | <span style="color: #00aaaa">Get-StringHash</span>
</pre>
</div>
153a6dfafcb532c42793a355d2f69e83

2)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-StringHash</span> <span style="color: #aa5500">"Creepy Cat Guy"</span>
</pre>
</div>
7d524c2e8c26ba908a2978300ba1d6eb

&nbsp;
<h3>Ping-AllHosts</h3>
This also isn’t really specific to SCOM but I found it useful in my own (SCOM) lab environment so I included it in this module. In my lab environment I have to ping my network devices occasionally to refresh the forwarding table on my cheap 1Gb switch so that they can be reached without first establishing a path. (I hope I’m explaining that clearly). Otherwise, my first connection attempt to my lab servers fails and I have to wait for it to timeout. Upon my second connection attempt, I can successfully connect. I will often let this continue to run in the background to keep those paths fresh. Mmmmmm, fresh paths!

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Ping-AllHosts1.jpg" rel="noopener"><img width="361" height="342" title="Ping-AllHosts1" alt="Ping-AllHosts1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Ping-AllHosts11.jpg" border="0" /></a>

Example:

This will ping all hosts a total of 999 times while pausing for 3 seconds between attempts.
1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Ping-AllHosts</span> -DelayMS 3000 -Count 999
</pre>
</div>
&nbsp;
<h3>Remove-SCOMObsoleteReferenceFromMPFile</h3>
This function will remove obsolete aliases from <strong>unsealed management pack</strong> <strong>.xml files</strong>, offline. This will not alter the original file but rather will output modified versions to the designated output folder.

Example:

This will modify a single .xml file:
1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Remove-SCOMObsoleteReferenceFromMPFile</span> -inFile <span style="color: #aa5500">'C:\Unsealed MPs\MyOverrides.xml'</span> -outDir <span style="color: #aa5500">'C:\Usealed MPs\Modified MPs'</span>
</pre>
</div>
This will retrieve all .xml files and pipe them into the function:
2)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Get-ChildItem</span> -Path <span style="color: #aa5500">'C:\CustomMPsExported'</span> | <span style="color: #00aaaa">Remove-SCOMObsoleteReferenceFromMPFile</span> -outDir <span style="color: #aa5500">'C:\Usealed MPs\Modified MPs'</span>
</pre>
</div>
&nbsp;
<h3>Set-SCOMMPAliases</h3>
This will standardize all of the aliases in one or more unsealed (.xml) management pack files.

Occasionally (unfortunately) it is necessary to move elements from one unsealed pack to another unsealed pack by cutting/pasting. When unsealed MPs are created by activities within the Console, the references/aliases that get created are randomly named/assigned and often times are ambiguous and usually inconsistent between unsealed packs. This makes it very difficult to cut from one file and place into another file because the aliases won’t match (this is assuming that the same/necessary references exist in both files).

This function will inventory all of the MP reference IDs that can be found in the single file (or set of .XML files) specified by the InputPath parameter. It will create a customized set of condensed alias acronyms to be standardized across all of the unsealed management packs. It will then replace the aliases in the Manifest section of the file(s) as well as throughout the file in elements where the aliases are used.

Note: This will modify the unsealed MPs located in the designated ‘InputPath’ location. However, the functionality of the MPs will not be affected.

Example:

1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Set-SCOMMPAliases</span> -InputPath <span style="color: #aa5500">'C:\UnSealedMPs\'</span>
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Set-SCOMMPAliases.jpg" rel="noopener"><img width="477" height="412" title="Set-SCOMMPAliases" alt="Set-SCOMMPAliases" src="https://msdnshared.blob.core.windows.net/media/2018/06/Set-SCOMMPAliases1.jpg" border="0" /></a>

This is an example of what your updated unsealed MP file will look like.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Set-SCOMMPAliases2.jpg" rel="noopener"><img width="422" height="484" title="Set-SCOMMPAliases2" alt="Set-SCOMMPAliases2" src="https://msdnshared.blob.core.windows.net/media/2018/06/Set-SCOMMPAliases21.jpg" border="0" /></a>

&nbsp;
<h3>Show-SCOMModules</h3>
Will display all known modules contained in all sealed management packs as well as basic schema information. Based on an original script found here: <a href="http://sc.scomurr.com/scom-2012-r2-mp-authoring-getting-modules-and-their-configurations/">http://sc.scomurr.com/scom-2012-r2-mp-authoring-getting-modules-and-their-configurations/</a>
This can prove to be useful when authoring or debugging.

I’m a big fan of Out-Gridview.

Example:

1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Show-SCOMModules</span> | <span style="color: #00aaaa">Out-GridView</span>
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Show-SCOMModules1.jpg" rel="noopener"><img width="666" height="348" title="Show-SCOMModules1" alt="Show-SCOMModules1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Show-SCOMModules11.jpg" border="0" /></a>

&nbsp;
<h3>Test-Port</h3>
This will test any number of TCP ports on any number of hosts. It will accept piped Computers/IPs or Ports and then test those ports on the targets for connectivity.

Example:

1)
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #00aaaa">Test-Port</span> -Computer db01,<span style="color: #aa5500">"192.168.1.1"</span>,<span style="color: #aa5500">'ms01.contoso.com'</span> -Port 80,53,139
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Test-Port1.jpg" rel="noopener"><img width="693" height="176" title="Test-Port1" alt="Test-Port1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Test-Port11.jpg" border="0" /></a>

&nbsp;
<h3>Unseal-SCOMMP</h3>
There are plenty of examples of how to unseal MP files but this version will Will unseal <strong>.MP and .MPB</strong> files along with any additional resources contained therein and place into <strong>version-coded folders</strong>.

Example:

1) This will unseal all of your Microsoft sealed packs (which normally get extracted/installed to the default SCOM MP folder location).

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">Unseal-SCOMMP -inDir <span style="color: #aa5500">'C:\Program Files (x86)\System Center Management Packs'</span> -outDir <span style="color: #aa5500">'C:\Temp\Unsealed'</span>
</pre>
</div>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Unseal-SCOMMP1.jpg" rel="noopener"><img width="533" height="449" title="Unseal-SCOMMP1" alt="Unseal-SCOMMP1" src="https://msdnshared.blob.core.windows.net/media/2018/06/Unseal-SCOMMP11.jpg" border="0" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2018/06/Unseal-SCOMMP2.jpg" rel="noopener"><img width="538" height="323" title="Unseal-SCOMMP2" alt="Unseal-SCOMMP2" src="https://msdnshared.blob.core.windows.net/media/2018/06/Unseal-SCOMMP21.jpg" border="0" /></a>

&nbsp;

&nbsp;
<h3>Installation:</h3>
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #000000">Find-Module</span> <span style="color: #000000">scomhelper</span> <span style="color: #000000">-Repository</span> <span style="color: #000000">PSGallery</span> <span style="color: #000000;font-weight: bold">|</span> <span style="color: #000000">Install-Module</span> <span style="color: #000000">-Verbose</span>
</pre>
</div>
Here's an example from my lab:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/SCOMHelper_Install2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/SCOMHelper_Install2-1024x523.jpg" alt="" width="879" height="449" /></a>

Additionally you can view more info at the <a target="_blank" href="https://www.powershellgallery.com/packages?q=scomhelper" rel="noopener">PSGallery</a>.

&nbsp;

Code snippets highlighted by <a href="http://hilite.me/">hilite.me</a>]]></content:encoded>
    </item>
    <item>
      <title>SCOM Sudoers Reference</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/scom-sudoers-reference</link>
      <pubDate>Thu, 14 Jun 2018 15:41:12 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=3305</guid>
      <description><![CDATA[&nbsp;

NOTE: These example sudoers configurations are compatible with SCOM 2012 R2. There have...]]></description>
      <content:encoded><![CDATA[&nbsp;

<strong>NOTE:</strong> These example sudoers configurations are compatible with SCOM 2012 R2. There have been some minor changes to the nix deployment kit names in SCOM 2016 and these changes have not been added below... YET.

If you would like to submit your additions for SCOM 2016, please do so in the comments and the community will thank you for it.

These are just examples. Use at your own risk. You are responsible for verifying the security of your environment. Always test in non-production environment first.

&nbsp;

<b>Redhat: </b>
# -----------------------------------------------------------------------------------

# User configuration for Operations Manager agent – for a user with the name: SCOMNIXAccount
# General requirements

Defaults:SCOMNIXAccount !requiretty
# Agent maintenance (discovery, install, uninstall, upgrade, restart, certificate signing

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cp /tmp/scx-SCOMNIXAccount/scx.pem /etc/opt/microsoft/scx/ssl/scx.pem; rm -rf /tmp/scx-SCOMNIXAccount; /opt/microsoft/scx/bin/tools/scxadmin -restart

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c sh /tmp/scx-SCOMNIXAccount/GetOSVersion.sh; EC=$?; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cat /etc/opt/microsoft/scx/ssl/scx.pem

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c rpm -e scx

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -F --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].rhel.[0-9].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -U --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].rhel.[0-9].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC
# Log file monitoring

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/scxlogfilereader -p
# Samples

## Custom shell command monitoring example – replace with the correct command string

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/bash -c
## Daemon diagnostic and restart recovery tasks example (using cron)

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c ps -ef | grep cron | grep -v grep

#SCOMNIXAccount ALL=(root) NOPASSWD: /usr/sbin/cron &amp;
# End user configuration for Operations Manager agent

# -----------------------------------------------------------------------------------

&nbsp;

<b>Solaris:</b>
# -----------------------------------------------------------------------------------

# User configuration for Operations Manager agent – for a user with the name: SCOMNIXAccount
# General requirements

Defaults:SCOMNIXAccount passwd_tries = 1, passwd_timeout = 1
# Agent maintenance (discovery, install, uninstall, upgrade, restart, certificate signing

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c sh /tmp/scx-SCOMNIXAccount/GetOSVersion.sh; EC=??; rm -rf /tmp/scx-SCOMNIXAccount; exit ?EC
## Solaris 9

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c echo -e "mail=*/usr/sbin/pkgadd -a /tmp/scx-SCOMNIXAccount/scx -n -d /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].solaris.9.sparc.pkg MSFTscx;*exit ?EC
## Solaris 10/11

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c echo -e "mail=*/usr/sbin/pkgadd -a /tmp/scx-SCOMNIXAccount/scx -n -d /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].solaris.1[0-1].sparc.pkg MSFTscx;*exit ?EC

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c echo -e "mail=*/usr/sbin/pkgadd -a /tmp/scx-SCOMNIXAccount/scx -n -d /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].solaris.1[0-1].x86.pkg MSFTscx;*exit ?EC
SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c rm -rf /tmp/scx-SCOMNIXAccount;*/usr/sbin/pkgrm -a /tmp/scx-SCOMNIXAccount/scx -n MSFTscx;*exit ?EC
SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c cat /etc/opt/microsoft/scx/ssl/scx.pem

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c rm -rf /tmp/scx-SCOMNIXAccount

SCOMNIXAccount ALL=(root) NOPASSWD: /usr/bin/sh -c cp /tmp/scx-SCOMNIXAccount/scx.pem /etc/opt/microsoft/scx/ssl/scx.pem; rm -rf /tmp/scx-SCOMNIXAccount; /opt/microsoft/scx/bin/tools/scxadmin -restart

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/tools/scxadmin
# Log file monitoring

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/scxlogfilereader -p
# Samples

## Custom shell command monitoring example – replace with the correct command string

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/bash -c
## Daemon diagnostic and restart recovery tasks example (using cron)

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c ps -ef | grep cron | grep -v grep

#SCOMNIXAccount ALL=(root) NOPASSWD: /usr/sbin/cron &amp;
# End user configuration for Operations Manager agent

# -----------------------------------------------------------------------------------

&nbsp;

<b>SUSE Enterprise</b>
# -----------------------------------------------------------------------------------

# User configuration for Operations Manager agent – for a user with the name: SCOMNIXAccount
# General requirements

Defaults:SCOMNIXAccount !requiretty
# Agent maintenance (discovery, install, uninstall, upgrade, restart, certificate signing

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cp /tmp/scx-SCOMNIXAccount/scx.pem /etc/opt/microsoft/scx/ssl/scx.pem; rm -rf /tmp/scx-SCOMNIXAccount; /opt/microsoft/scx/bin/tools/scxadmin -restart

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c sh /tmp/scx-SCOMNIXAccount/GetOSVersion.sh; EC=$?; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cat /etc/opt/microsoft/scx/ssl/scx.pem

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c rpm -e scx
## SuSE Linux Enterprise Server 9

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -F --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].sles.9.x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -U --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].sles.9.x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC
## SuSE Linux Enterprise Server 10/11/12

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -F --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].sles.1[0|1|2].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -U --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].sles.1[0|1|2].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC
# Log file monitoring

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/scxlogfilereader -p
# Samples

## Custom shell command monitoring example – replace with the correct command string

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/bash -c
## Daemon diagnostic and restart recovery tasks example (using cron)

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c ps -ef | grep cron | grep -v grep

#SCOMNIXAccount ALL=(root) NOPASSWD: /usr/sbin/cron &amp;
# End user configuration for Operations Manager agent

# -----------------------------------------------------------------------------------

&nbsp;

<b>Universal: Debian, Ubuntu</b>
# -----------------------------------------------------------------------------------

# User configuration for Operations Manager agent – for a user with the name: SCOMNIXAccount
# General requirements

Defaults:SCOMNIXAccount !requiretty
# Agent maintenance (discovery, install, uninstall, upgrade, restart, certificate signing

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cp /tmp/scx-SCOMNIXAccount/scx.pem /etc/opt/microsoft/scx/ssl/scx.pem; rm -rf /tmp/scx-SCOMNIXAccount; /opt/microsoft/scx/bin/tools/scxadmin -restart

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c sh /tmp/scx-SCOMNIXAccount/GetOSVersion.sh; EC=$?; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cat /etc/opt/microsoft/scx/ssl/scx.pem

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c dpkg -P scx

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c dpkg -i /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].universald.1.x[6-8][4-6].deb; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC
# Log file monitoring

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/scxlogfilereader -p
# Samples

## Custom shell command monitoring example – replace with the correct command string

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/bash -c
## Daemon diagnostic and restart recovery tasks example (using cron)

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c ps -ef | grep cron | grep -v grep

#SCOMNIXAccount ALL=(root) NOPASSWD: /usr/sbin/cron &amp;
# End user configuration for Operations Manager agent

# -----------------------------------------------------------------------------------

&nbsp;

<b>Universal: Centos, Oracle Linux</b>
# -----------------------------------------------------------------------------------

# User configuration for Operations Manager agent – for a user with the name: SCOMNIXAccount
# General requirements

Defaults:SCOMNIXAccount !requiretty
# Agent maintenance (discovery, install, uninstall, upgrade, restart, certificate signing

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cp /tmp/scx-SCOMNIXAccount/scx.pem /etc/opt/microsoft/scx/ssl/scx.pem; rm -rf /tmp/scx-SCOMNIXAccount; /opt/microsoft/scx/bin/tools/scxadmin -restart

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c sh /tmp/scx-SCOMNIXAccount/GetOSVersion.sh; EC=$?; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c cat /etc/opt/microsoft/scx/ssl/scx.pem

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c rpm -e scx

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -F --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].universalr.[0-9].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC

SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c /bin/rpm -U --force /tmp/scx-SCOMNIXAccount/scx-1.[0-9].[0-9]-[0-9][0-9][0-9].universalr.[0-9].x[6-8][4-6].rpm; EC=$?; cd /tmp; rm -rf /tmp/scx-SCOMNIXAccount; exit $EC
# Log file monitoring

SCOMNIXAccount ALL=(root) NOPASSWD: /opt/microsoft/scx/bin/scxlogfilereader -p
# Samples

## Custom shell command monitoring example – replace with the correct command string

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/bash -c
## Daemon diagnostic and restart recovery tasks example (using cron)

#SCOMNIXAccount ALL=(root) NOPASSWD: /bin/sh -c ps -ef | grep cron | grep -v grep

#SCOMNIXAccount ALL=(root) NOPASSWD: /usr/sbin/cron &amp;
# End user configuration for Operations Manager agent

# -----------------------------------------------------------------------------------

&nbsp;

&nbsp;

<span class="descriptionSubSectionTitle">Disclaimer:</span>

<span>The code samples are not supported under any Microsoft standard support program or service. The code samples are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the code samples and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the code samples or documentation, even if Microsoft has been advised of the possibility of such damages.</span>]]></content:encoded>
    </item>
    <item>
      <title>Class Viewer: An Easy Way to View Class Hierarchy and Hosting Relationships in the Operations Manager Console</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/class-viewer-an-easy-way-to-view-class-hierarchy-and-hosting-relationships-in-the-operations-manager-console</link>
      <pubDate>Wed, 02 May 2018 21:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=3225</guid>
      <description><![CDATA[Up until now there has been no easy way to get a good, visual perspective on the classes and hosting...]]></description>
      <content:encoded><![CDATA[Up until now there has been no easy way to get a good, visual perspective on the classes and hosting relationships that exist in your SCOM management group. I introduce ClassViewer; a script that will add a Web Page view into your Monitoring workspace so that you can see all classes in your management group as well as properties and hosting relationships.

<a target="_blank" href="https://gallery.technet.microsoft.com/scriptcenter/Class-Viewer-An-Easy-Way-f6bde2f3" rel="noopener">Download</a>
<h4>Overview:</h4>
This script will generate an .html file for each known class in your management group and also a single “master’ file which contains a filter-enabled list of all the classes. The files will need to exist under a virtual directory on a web server.
<h4>Which web server?</h4>
This is up to you. I recommend using your existing SCOM Web Console server “OperationsManager” virtual directory.
<h4>How many classes are there? How many files will be created?</h4>
This depends on your management group. All management groups are different, with different customizations and different management packs loaded. You can expect somewhere between 1000 and 2000 individual .html files to be created in a subdirectory; 1 per class. (My lab instance has 263 MPs and 1644 classes)

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer10.jpg"><img width="1699" height="725" title="classviewer10" alt="classviewer10" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer10_thumb.jpg" border="0" /></a>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer11.jpg"><img width="903" height="1015" title="classviewer11" alt="classviewer11" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer11_thumb.jpg" border="0" /></a>

&nbsp;
<h4><span style="color: #d16349">Installation Steps:</span></h4>
1) Download the .zip and extract the contents to a local folder on your web server. Usually this would be your SCOM Web Console server.

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer0.jpg"><img width="855" height="465" title="classviewer0" alt="classviewer0" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer0_thumb.jpg" border="0" /></a>

2) Open a PowerShell Console (ideally the Operations Manager Console). Navigate to the folder where you extracted the files.

3) Launch the script from the PowerShell Console. You will be prompted for two mandatory parameters:

<strong>OutDir</strong> and <strong>URL</strong>.

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer1.jpg"><img width="1095" height="658" title="classviewer1" alt="classviewer1" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer1_thumb.jpg" border="0" /></a>

<strong>About the parameters: OutDir, URL</strong>

If either of these parameters are not provided at the command line, the user will be prompted to input values for each parameter. The value for <strong>OutDir</strong> should be where your web server virtual directory is located. Once this value is provided by the user, a subfolder, "classviewer", will be created automatically in this path.  It is in this subfolder where all of the individual .html files for each class description will be created. Remember, there will be upwards of 1000 individual files created inside this new subfolder.
(Note: For this parameter you can provide the path to any local folder as long as the new subfolder “classviewer” is located in your web server virtual directory where it can be accessed via HTTP/s. )

A good path to use for this parameter is the physical path to your "OperationsManager" virtual directory on your SCOM Web Console server. Most often this virtual directory is located at these typical locations depending on your version of SCOM:

C:\Program Files\Microsoft System Center <strong>2016</strong>\Operations Manager\WebConsole\WebHost
C:\Program Files\Microsoft System Center <strong>2012</strong>\Operations Manager\WebConsole\WebHost
C:\Program Files\Microsoft System Center <strong>2012 R2</strong>\Operations Manager\WebConsole\WebHost
Typically the folder you choose for the <strong>OutDir</strong> parameter is made available by your web server through the value specified for the <strong>URL</strong> parameter.

Example: the physical (<strong>OutDir</strong>) path might be the following:
C:\Program Files\Microsoft System Center 2016\Operations Manager\WebConsole\WebHost

The subfolder will get created automatically by the script:
C:\Program Files\Microsoft System Center 2016\Operations Manager\WebConsole\WebHost\<strong><em>classviewer</em></strong>

This physical path would be accessible via this example URL for your Web Console server:
<a href="http://yourMGMTserver/OperationsManager/classviewer">HTTP://yourMGMTserver/OperationsManager/<strong>classviewer</strong></a>

<span>It is this OperationsManger virtual directory URL that you would specify for the <strong>URL</strong> parameter:</span>
<a href="http://yourMGMTserver/OperationsManager">HTTP://yourMGMTserver/OperationsManager</a>
Do not include "classviewer". This will get added automatically by the script.

Ultimately it is THIS path that will be added automatically to the View in the provided unsealed MP (ClassViewer.xml):
<a href="http://yourMGMTserver/OperationsManager/classviewer/MasterClassFile.html">HTTP://yourMGMTserver/OperationsManager/classviewer/MasterClassFile.html</a>

In this example, it is this URL above which must be accessible from the Console server (where the Console is launched; this could be your workstation or any other server where the Console is installed).

Note: If you have more than one Web Console server in your management group (example: in a load balanced scenario), you will need to perform this installation on any servers that may receive traffic at the designated URL. Each web server will need a set of the .html files.

After you provide the <strong>OutDir</strong> and <strong>URL</strong> values the script should proceed to generate the output files at the <strong>OutDir</strong> path that was previously provided.

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer2.jpg"><img width="1096" height="771" title="classviewer2" alt="classviewer2" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer2_thumb.jpg" border="0" /></a>

In my lab I used this value for <strong>OutDir</strong>:

<strong><em>C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\WebConsole\WebHost</em></strong>

I used this value for <strong>URL</strong>:

<strong><em><a href="http://ms01/OperationsManager">HTTP://ms01/OperationsManager</a></em></strong>

This is the value that got created inside the ClassViewer.xml file. As you will notice, it is encoded.

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer9.jpg"><img width="963" height="358" title="classviewer9" alt="classviewer9" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer9_thumb.jpg" border="0" /></a>

It results to this (unencoded):

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer8.jpg"><img width="529" height="306" title="classviewer8" alt="classviewer8" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer8_thumb.jpg" border="0" /></a>

You will be prompted to import the ClassViewer.xml unsealed management pack. This management pack contains the preconfigured Web Page View. (SCOM Administrator rights will be required. )

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer3.jpg"><img width="1094" height="201" title="classviewer3" alt="classviewer3" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer3_thumb.jpg" border="0" /></a>

Success!

<a href="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer4.jpg"><img width="1089" height="207" title="classviewer4" alt="classviewer4" src="https://msdnshared.blob.core.windows.net/media/2018/05/classviewer4_thumb.jpg" border="0" /></a>

You can run the script again at any time to update the class files.

&nbsp;

Comments? Suggestions? Let’s Have’em.

Thanks to <a target="_blank" href="http://blog.scomskills.com/" rel="noopener">Jon Almquist</a> for the idea.]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio ‘Failed to verify module reference’ Authoring SCOM Management Pack, VSAE</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/visual-studio-failed-to-verify-module-reference-authoring-scom-management-pack-vsae</link>
      <pubDate>Fri, 20 Apr 2018 23:21:29 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=3015</guid>
      <description><![CDATA[Today I’m writing about an elusive problem with a management pack that I was authoring recently. I...]]></description>
      <content:encoded><![CDATA[<p><br></p><p><font face="Verdana">Today I’m writing about an elusive problem with a management pack that I was authoring recently. I was writing a generic datasource for a registry discovery; that is a discovery that will instantiate a class based on the existence of a registry key on the Target machine, and generic because I will use a single RegistryProbe datasource for discovery of multiple different class types. (This will save me some time down the road when using the VSAE Discovery template group in Visual Studio). If the registry key exists, the specified class will be discovered. When I attempted to initiate a build (something I do incrementally after minor changes to verify that what I just changed is valid) I encountered an ambiguous error: </font></p><p><font color="#ff0000" face="Verdana">------ Build started: Project: WF.Fax, Configuration: Debug x86 ------<br>&nbsp;&nbsp;&nbsp;&nbsp; Starting MP Build for WF.Fax.<br>&nbsp;&nbsp;&nbsp;&nbsp; Starting Fragment Verification<br>&nbsp;&nbsp;&nbsp;&nbsp; Resolving Project References<br>&nbsp;&nbsp;&nbsp;&nbsp; Starting Merge Management Pack Fragments<br>&nbsp;&nbsp;&nbsp;&nbsp; Starting Pre Processing<br>&nbsp;&nbsp;&nbsp;&nbsp; Starting MP Verify<br>
Service Model\Classes.mpx(10,9): warning TypeDefinitionInUnsealedMP: Unsealed management packs should not contain type definitions.&nbsp; The element WF.Fax.RightFax.Server.Class of type ManagementPackClass found in an unsealed management pack.&nbsp;&nbsp; (Path = WF.Fax.RightFax.Server.Class)<br>
C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(270,5): error : Failed to verify module reference [Type=ManagementPackElement=System.Discovery.ClassSnapshotDataMapper in ManagementPack:[Name=System.Library, KeyToken=31bf3856ad364e35, Version=7.5.8501.0], ID=Mapping] in the MemberModules list.<br>
: Incorrect XPATH reference: ClassId.<br>&nbsp;&nbsp;&nbsp; (Path = WF.Fax.RegistryProbe.Discovery.DS/Mapping)<br>
Done building project "WF.Fax.mpproj" -- FAILED.</font></p><font color="#ff0000" face="Verdana">
</font><p><font color="#ff0000" face="Verdana">========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========</font></p><p><font face="Verdana">There were a few key pieces of info here:</font></p><p><font face="Verdana"><strong>Failed to verify module reference [Type=ManagementPackElement=System.Discovery.ClassSnapshotDataMapper </strong><br> - This tells me there is something wrong with how I’m using this module. </font></p><p><font face="Verdana"><strong>Incorrect XPATH reference: ClassId</strong><br> -&nbsp; This tells me there something wrong with this parameter </font></p><p><font face="Verdana"><strong>(Path = WF.Fax.RegistryProbe.Discovery.DS/Mapping)</strong><br> -&nbsp; This tells me where the problem is located: in the ‘Mapping’ section of the ‘WF.Fax.RegistryProbe.Discovery.DS’ module.</font></p><p><font face="Verdana">I once again visited the MSDN site where I found documentation for the reference module (</font><a title="https://msdn.microsoft.com/en-us/library/ee692953.aspx" href="https://msdn.microsoft.com/en-us/library/ee692953.aspx"><font face="Verdana">https://msdn.microsoft.com/en-us/library/ee692953.aspx</font></a><font face="Verdana">) and I copied the section of code from the Example into my Visual Studio 2017 SCOM 2016 MP project and BAM! I was able to build it successfully. The code from the example appeared to be absolutely identical to what I had first written. </font></p><p><font face="Verdana">Here’s what I first used (broken):<br></font><font face="Verdana">
&lt;ConditionDetection ID="Mapping" TypeID="System!System.Discovery.ClassSnapshotDataMapper"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--</font><a href="https://msdn.microsoft.com/en-us/library/ee692953.aspx--"><font face="Verdana">https://msdn.microsoft.com/en-us/library/ee692953.aspx--</font></a><font face="Verdana">&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;ClassId&gt;$Config/ClassId$&lt;/ClassId&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;InstanceSettings&gt;$Config/InstanceSettings$&lt;/InstanceSettings&gt;<br>
&lt;/ConditionDetection&gt;</font></p><p><font face="Verdana">Here’s the working code (builds successfully):<br></font><font face="Verdana">
&lt;ConditionDetection ID="Mapping" TypeID="System!System.Discovery.ClassSnapshotDataMapper"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--</font><a href="https://msdn.microsoft.com/en-us/library/ee692953.aspx--"><font face="Verdana">https://msdn.microsoft.com/en-us/library/ee692953.aspx--</font></a><font face="Verdana"><font>&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;ClassId&gt;$Config/ClassID$&lt;/ClassId&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;InstanceSettings&gt;$Config/InstanceSettings$&lt;/InstanceSettings&gt;<br>
&lt;/ConditionDetection&gt;</font><br></font></p><font face="Verdana">
</font><p><br></p><p><font face="Verdana">Notice anything different about those two snippets?&nbsp; Well I didn’t see a darn thing different but one would build and the other would not. Why? Whyyyyy?!?! I was getting really frustrated because I needed to know. I decided to go toe to toe with the universe on this one and bust out some PowerShell skills to solve my problem. I decided to do an individual character comparison of the two strings. </font></p><p><font face="Verdana">I’m not sharing the MP at this time because it’s for a customer and it’s actually not finished yet (at the time of this writing) but <strong>here’s the resulting script available for </strong></font><a href="https://gallery.technet.microsoft.com/scriptcenter/Detailed-String-Comparison-98c9583e" target="_blank"><font face="Verdana"><strong>download</strong></font></a><font face="Verdana">. My initial version was much uglier but I decided to polish it up and add it to the Gallery so maybe it might help others some day. </font></p><p><em><font face="Verdana">“This is an easy way to compare two strings. The script will compare individual characters and output the ASCII values, hash values, and comparison results for each. This is useful when two strings appear to be the same but may have different characters (encodings or ASCII values). The script contains a function of the same name so that this can be included easily into a profile or module.” (Example: ‘dot source’ the script in your PowerShell profile.)</font></em></p><p><font face="Verdana">Here’s an example of how the script works: </font></p><p><a href="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String1.jpg"><font face="Verdana"><img width="855" height="259" title="VSBuildError-Compare_String1" alt="VSBuildError-Compare_String1" src="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String1_thumb.jpg" border="0"></font></a></p><p><font face="Verdana"><br></font></p><p><font face="Verdana">In order to solve the mystery of why the universe was smiting me I created two “here” strings, one for each snippet of code and then I compared them with the script: </font></p><p><a href="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String2.jpg"><font face="Verdana"><img width="855" height="281" title="VSBuildError-Compare_String2" alt="VSBuildError-Compare_String2" src="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String2_thumb.jpg" border="0"></font></a></p><p><font face="Verdana">The Result:</font></p><p><a href="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String_result1.jpg"><font face="Verdana"><img width="855" height="288" title="VSBuildError-Compare_String_result1" alt="VSBuildError-Compare_String_result1" src="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError-Compare_String_result1_thumb.jpg" border="0"></font></a></p><p><p><font face="Verdana"><strong><br></strong></font></p><font face="Verdana">Notice in my datasource Configuration: <strong>ClassID</strong>&nbsp;</font></p><p><font face="Verdana"><a href="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError1-3.jpg"><font face="Verdana"><img width="855" height="547" title="VSBuildError1-3" alt="VSBuildError1-3" src="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError1-3_thumb.jpg" border="0"></font></a></font></p><p><font face="Verdana">Here’s the problem:</font></p><p><font face="Verdana">“<strong>ID</strong>” should be capitalized in “Class<strong>ID</strong>”.</font>&nbsp; </p><p><font face="Verdana"><a href="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError1-4.jpg"><img width="855" height="114" title="VSBuildError1-4" alt="VSBuildError1-4" src="https://msdnshared.blob.core.windows.net/media/2018/04/VSBuildError1-4_thumb.jpg" border="0"></a></font></p><p><font face="Verdana">Mystery solved, I’m an idiot. I overlooked one single character. </font></p><p><font face="Verdana">This error should have tipped me off: <strong>Incorrect XPATH reference: ClassId</strong></font></p><p><font face="Verdana">I went to a bit of trouble to track down the answer here and in the end it was a tiny typo. This is not the first time that a tiny typo like this or hidden encoded character has caused me major headache. Now I have another script to add to my toolset so hopefully next time I can breeze through the problem in little time. </font></p>]]></content:encoded>
    </item>
    <item>
      <title>SCOM: Export Rules, Monitors, Overrides, Settings, Effective Monitoring Configuration with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/scom-export-rules-monitors-overrides-settings-effective-monitoring-configuration-with-powershell</link>
      <pubDate>Sat, 24 Mar 2018 01:28:08 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=2755</guid>
      <description><![CDATA[2018.03.23: (This is a reboot of a previous post. I revised the title, script, and photos a bit.)
I...]]></description>
      <content:encoded><![CDATA[<h6>2018.03.23: (This is a reboot of a previous post. I revised the title, script, and photos a bit.)</h6>
I was working on a support case recently when it was brought to my attention that this cmdlet, <strong>Export-SCOMEffectiveMonitoringConfiguration, </strong> does <strong>not</strong> output ALL contained instance configurations even when the "<strong>-RecurseContainedObjects</strong>" parameter is used. Yes, really!  It outputs configuration data for only one instance of each particular type, be it a logical disk or Ethernet adapter etc., you only get monitor and rule configuration output for one of a kind in the resulting .csv file. <span>If you have three logical disks (i.e. C:, D:, E:) you will only see configuration data for one of those, whichever one gets enumerated first by the cmdlet. </span>

To overcome this limitation I've written a script that targets a group, and "recurses" <strong>all</strong> contained objects, outputs each configuration set to a separate file, then merges all of the files together to create one complete .CSV. (Thanks to Matt Hofacker for the idea) It can optionally open the complete dataset with PowerShell GridView (great idea StefanRoth!) for easy viewing and filtering. The merged CSV file can be opened in Excel if needed.

This has been baked into the SCOMHelper PowerShell module available <a target="_blank" href="https://blogs.msdn.microsoft.com/tysonpaul/2018/08/06/scomhelper-powershell-module-a-scom-admins-best-friend/" rel="noopener">here</a>.
Tested with Operations Manager 2016, 2012 R2

Enjoy.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig1-1024x431.jpg" alt="" width="1024" height="431" class="aligncenter size-large wp-image-2765" /></a>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig2-1024x575.jpg" alt="" width="1024" height="575" class="aligncenter size-large wp-image-2775" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig3.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig3-1024x518.jpg" alt="" width="1024" height="518" class="aligncenter size-large wp-image-2785" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig4.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/EffectiveMonConfig4-1024x520.jpg" alt="" width="1024" height="520" class="aligncenter size-large wp-image-2795" /></a>

&nbsp;

History:

2018.04.06:  Added "Rule/Monitor <strong>DisplayName</strong>" column to output.]]></content:encoded>
    </item>
    <item>
      <title>Export SCOM Rule and Monitor Knowledge Articles with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/export-scom-rule-and-monitor-knowledge-articles-with-powershell</link>
      <pubDate>Fri, 15 Dec 2017 21:49:12 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=2595</guid>
      <description><![CDATA[This has been baked into the SCOMHelper PowerShell module available here.

Related: How to Get...]]></description>
      <content:encoded><![CDATA[This has been baked into the SCOMHelper PowerShell module available <a target="_blank" href="https://blogs.msdn.microsoft.com/tysonpaul/2018/08/06/scomhelper-powershell-module-a-scom-admins-best-friend/" rel="noopener">here</a>.

<strong>Related</strong>: <a href="https://blogs.msdn.microsoft.com/tysonpaul/2016/03/31/how-to-get-knowledge-article-from-a-scom-alert-with-powershell/">How to Get Knowledge Article from a SCOM Alert with Powershell</a>

This will output workflow information (including Knowledge Article content) to an HTML report or CSV file. Script accepts one or more (or all) management pack objects as input. Can export from SCOM using the SDK connection OR from management pack files.
<h4>Report Example</h4>
<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Report1.jpg"><img width="855" height="408" title="Export-SCOMKnowledge_Report1" alt="Export-SCOMKnowledge_Report1" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Report1_thumb.jpg" border="0" /></a>
<h4></h4>
<h4>Usage Examples</h4>
<h5>All Active Directory Management Packs:</h5>
<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge0.jpg"><img width="855" height="171" title="Export-SCOMKnowledge0" alt="Export-SCOMKnowledge0" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge0_thumb.jpg" border="0" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge1.jpg"><img width="855" height="497" title="Export-SCOMKnowledge1" alt="Export-SCOMKnowledge1" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge1_thumb.jpg" border="0" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge2.jpg"><img width="855" height="344" title="Export-SCOMKnowledge2" alt="Export-SCOMKnowledge2" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge2_thumb.jpg" border="0" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Explorer1.jpg"><img width="855" height="415" title="Export-SCOMKnowledge_Explorer1" alt="Export-SCOMKnowledge_Explorer1" src="https://msdnshared.blob.core.windows.net/media/2017/12/Export-SCOMKnowledge_Explorer1_thumb.jpg" border="0" /></a>

<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">(<span style="color: #008000">Get-SCOMManagementPack</span> -Name *.AD.*) | .\<span style="color: #008000">Export-SCOMKnowledge</span>.ps1 -OutFolder <span style="color: #ba2121">'C:\MyReports'</span> -Topic <span style="color: #ba2121">"AD_"</span> -ShowResult
</pre>
</div>
In the example above all management pack objects with ".AD." in the name will be piped into the script. The script will output workflow details for all Rules and Monitors contained in ALL management packs within that set.
The output file names will be: "AD_Rules.html" and "AD_Monitors.html". Finally the script will open Windows File Explorer to the location of the output directory.

&nbsp;
<h5>All Active Directory Management Packs with Filtered Workflow Name:</h5>
<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">.\<span style="color: #008000">Export-SCOMKnowledge</span>.ps1 -OutFolder <span style="color: #ba2121">'C:\Export'</span> -ManagementPack (<span style="color: #008000">Get-SCOMManagementPack</span> -Name <span style="color: #ba2121">"*ad.*"</span>) -Filter <span style="color: #ba2121">'201[0-6]'</span>
</pre>
</div>
The command above will output all rules/monitors from management packs which contain 'ad.' in the Name and which contain '201x' in the Name or DisplayName of the workflow where 'x' represents any single digit 0-6 .

<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">.\<span style="color: #008000">Export-SCOMKnowledge</span>.ps1 -OutFolder <span style="color: #ba2121">'C:\Export'</span> -ManagementPack (<span style="color: #008000">Get-SCOMManagementPack</span> -Name <span style="color: #ba2121">"*ad.*"</span>) -Filter <span style="color: #ba2121">'(?=200[0-8])((?!Monitoring).)*$'</span>
</pre>
</div>
The command above will output all rules/monitors from management packs which contain 'ad' in the Name and which contain '200x' in the Name or DisplayName of the workflow where 'x' is numbers 1-8 but excluding workflows that contain 'monitoring'.

&nbsp;
<h5>All SQL MPs:</h5>
<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">.\<span style="color: #008000">Export-SCOMKnowledge</span>.ps1 -OutFolder <span style="color: #ba2121">"C:\Temp"</span> -ManagementPack (<span style="color: #008000">Get-SCOMManagementPack</span> -Name *SQL*) -Topic <span style="color: #ba2121">"SQL_Packs_"</span>
</pre>
</div>
The command above will output workflow details for all Rules and Monitors contained in ALL management packs with "SQL" in the management pack Name.  The output file names will be: "SQL_Packs_Rules.html" and "SQL_Packs_Monitors.html"

&nbsp;
<h5>ALL Rules and Monitors in the SCOM Management Group:</h5>
<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%">.\<span style="color: #008000">Export-SCOMKnowledge</span>.ps1 -OutFolder <span style="color: #ba2121">"C:\MyReports"</span> -ManagementServer <span style="color: #ba2121">"ms01.contoso.com"</span> -NoKnowledgeExclude
</pre>
</div>
In the example above, the command will connect to management server: "ms01.contoso.com", will output workflow details for all Rules and Monitors (only if they contain a Knowledge Article) to two separate files in the specified folder. The output file names will be: "Rules.html" and "Monitors.html"

&nbsp;
<h5>This is a way to use management pack files (.mp and .xml) from a directory path with specific topics.
The below script example will use management pack files which names match the array of Topics.</h5>
<!-- HTML generated using hilite.me -->
<div style="background: #f8f8f8;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #408080;font-style: italic">##---- CONFIGURE THESE VARIABLES ----##</span>
<span style="color: #408080;font-style: italic"># Location of management pack files</span>
<span style="color: #19177c">$inDir</span> = <span style="color: #ba2121">'C:\Program Files (x86)\System Center Management Packs\'</span>
<span style="color: #408080;font-style: italic"># Output directory</span>
<span style="color: #19177c">$outDir</span> = <span style="color: #ba2121">'C:\'</span>
<span style="color: #408080;font-style: italic"># Management pack file names which match these strings will be selected</span>
<span style="color: #19177c">$topics</span> = <span style="color: #ba2121">"DHCP,DNS,FileServices,GroupPolicy,DFS,FileReplication"</span>
<span style="color: #408080;font-style: italic">##---- CONFIGURE THESE VARIABLES ----##</span>

<span style="color: #19177c">$FilePaths</span> =<span style="border: 1px solid #FF0000">@</span>()
<span style="color: #19177c">$h</span> = <span style="border: 1px solid #FF0000">@</span>{}
<span style="color: #408080;font-style: italic"># Will export data for each management pack file name matching the topic name. </span>
<span style="color: #008000;font-weight: bold">ForEach</span> (<span style="color: #19177c">$topic</span> <span style="color: #008000;font-weight: bold">in</span> <span style="color: #19177c">$topics</span>.Split(<span style="color: #ba2121">','</span>)){
    <span style="color: #008000">Write-Host</span> <span style="color: #ba2121">"Topic: $topic"</span> -BackgroundColor Black -ForegroundColor Yellow
    <span style="color: #19177c">$FilePaths</span> = <span style="color: #008000">Get-ChildItem</span> -Recurse -Include <span style="color: #ba2121">"*$topic*.mp*"</span>,<span style="color: #ba2121">"*$topic*.xml*"</span> <span style="color: #666666">-File</span> -Path <span style="color: #19177c">$inDir</span> | Select fullname
    <span style="color: #19177c">$FilePaths</span> | <span style="color: #008000;font-weight: bold">ForEach</span> {<span style="color: #19177c">$h</span>.(<span style="color: #008000">Split-Path</span> <span style="color: #19177c">$_</span>.FullName -Leaf) = <span style="color: #19177c">$_</span>.FullName }
    <span style="color: #008000;font-weight: bold">If</span> (!(<span style="color: #19177c">$h</span>.Count)){ <span style="color: #008000;font-weight: bold">Continue</span><span style="border: 1px solid #FF0000">;</span>} <span style="color: #408080;font-style: italic">#If no matching file found, skip to next topic</span>
    <span style="color: #19177c">$h</span>.Keys
    <span style="color: #ba2121">""</span>
    <span style="color: #19177c">$MPs</span> = (<span style="color: #008000">Get-SCOMManagementPack</span> -ManagementPackFile (<span style="color: #19177c">$h</span>.Values | % {<span style="color: #19177c">$_</span>} )  )
    &amp; <span style="color: #ba2121">'.\Export-SCOMKnowledge.ps1'</span> -OutFolder <span style="color: #19177c">$outDir</span> -ManagementPack <span style="color: #19177c">$MPs</span> -Topic <span style="color: #19177c">$Topic</span>
}
</pre>
</div>
&nbsp;

Code samples generated with <a href="http://hilite.me">hilite.me</a>

Related:

<a href="https://blogs.msdn.microsoft.com/tysonpaul/2016/03/31/how-to-get-knowledge-article-from-a-scom-alert-with-powershell/">How to Get Knowledge Article from a SCOM Alert with Powershell</a>]]></content:encoded>
    </item>
    <item>
      <title>SCOM Operations Manager Shell PowerShell Error When Launched as Administrator</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/scom-operations-manager-shell-powershell-error-when-launched-as-administrator</link>
      <pubDate>Fri, 28 Apr 2017 20:25:37 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=2376</guid>
      <description><![CDATA[Sometimes when the Operations Manager Shell is opened as an Administrator you will see the error in...]]></description>
      <content:encoded><![CDATA[<span style="font-size: large">Sometimes when the Operations Manager Shell is opened as an Administrator you will see the error in the screenshot below. I believe this has to do with how User Account Control (or UAC) is configured. The “Start in” parameter on the shortcut is ignored and the shortcut is unable to locate the startup scripts. </span>

<span style="font-size: large"></span>

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/shortcut.jpg"><img width="469" height="694" title="shortcut" style="border: 0px currentColor;padding-top: 0px;padding-right: 0px;padding-left: 0px" alt="shortcut" src="https://msdnshared.blob.core.windows.net/media/2017/04/shortcut_thumb.jpg" border="0" /></a>

&nbsp;

<span style="font-size: large">"</span><span style="color: #ff0000">.\OperationsManager\Functions.ps1 : The term '.\OperationsManager\Functions.ps1' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:34
+ ... t-Module OperationsManager; .\OperationsManager\Functions.ps1; .\Oper ...
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (.\OperationsManager\Functions.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException</span>

<span style="color: #ff0000">.\OperationsManager\Startup.ps1 : The term '.\OperationsManager\Startup.ps1' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:69
+ ... r; .\OperationsManager\Functions.ps1; .\OperationsManager\Startup.ps1
+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (.\OperationsManager\Startup.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException</span>

<strong>PS C:\Windows\system32&gt;</strong><span style="font-size: large">"</span>

<span style="font-size: large"></span>

<span style="font-size: large"><a href="https://msdnshared.blob.core.windows.net/media/2017/04/LaunchErrors.jpg"><img width="1150" height="453" title="LaunchErrors" style="border: 0px currentColor;padding-top: 0px;padding-right: 0px;padding-left: 0px" alt="LaunchErrors" src="https://msdnshared.blob.core.windows.net/media/2017/04/LaunchErrors_thumb.jpg" border="0" /></a></span>

&nbsp;

<span style="font-size: large">Here’s one easy workaround to fix the problem: simply run the line of code in ANY elevated PowerShell console (as Administrator). This will add a very simple command to your general profile that will set the location of the prompt so that the OpsMan startup scripts can be located by the shortcut. You only need to run this PowerShell code (below) once on each server where the Console is installed. </span>
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #996633">$CMD</span> = <span style="background-color: #fff0f0">'$SCOMInstallPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup" -Name "InstallDirectory").InstallDirectory; Set-Location $SCOMInstallPath\..\PowerShell'</span>
<span style="color: #007020">Add-Content</span> -Path <span style="color: #996633">$profile</span>.AllUsersAllHosts -Value <span style="color: #996633">$CMD</span> -verbose <span style="color: #ff0000;background-color: #ffaaaa">–</span>Force
</pre>
</div>
&nbsp;

Simply copy and paste into an elevated console:
<a href="https://msdnshared.blob.core.windows.net/media/2017/04/SetProfile.jpg"><img width="1150" height="233" title="SetProfile" style="border: 0px currentColor;padding-top: 0px;padding-right: 0px;padding-left: 0px" alt="SetProfile" src="https://msdnshared.blob.core.windows.net/media/2017/04/SetProfile_thumb.jpg" border="0" /></a>

<span style="font-size: large"></span>

<span style="font-size: large">If your Opsman shell is open, close it. Reopen it as Administrator. Problem solved. </span>

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/Shell_Is_Happy.jpg"><img width="1150" height="345" title="Shell_Is_Happy" style="border: 0px currentColor;padding-top: 0px;padding-right: 0px;padding-left: 0px" alt="Shell_Is_Happy" src="https://msdnshared.blob.core.windows.net/media/2017/04/Shell_Is_Happy_thumb.jpg" border="0" /></a>

&nbsp;

<span style="font-size: large">To view your profile paths use this command: </span>

<!-- HTML generated using hilite.me -->
<div style="background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em">
<pre style="margin: 0;line-height: 125%"><span style="color: #996633">$profile</span> | <span style="color: #007020">Select-Object</span> -Property *
</pre>
</div>

&nbsp;&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SCOM Printer Monitoring Management Pack Supplement (Updated: Windows Server 2003, 2008, 2012, 2016)</title>
      <link>https://docs.microsoft.com/archive/blogs/tysonpaul/scom-printer-monitoring-management-pack-supplement-updated-windows-server-2003-2008-2012-2016</link>
      <pubDate>Fri, 28 Apr 2017 20:06:27 GMT</pubDate>
      <dc:creator><![CDATA[Tyson.Paul]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tysonpaul/?p=2315</guid>
      <description><![CDATA[&nbsp; Back in 2010 Steve Rachui posted a fantastic management pack which added support for...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <p>Back in 2010 Steve Rachui posted a fantastic management pack which added support for monitoring Windows 2003 and 2008 print servers. The original post is located here so you can read all about the functionality: </p> <p><a title="https://blogs.msdn.microsoft.com/steverac/2010/12/04/focusing-on-the-printer-printer-monitoring-mp-supplement/" href="https://blogs.msdn.microsoft.com/steverac/2010/12/04/focusing-on-the-printer-printer-monitoring-mp-supplement/" target="_blank">https://blogs.msdn.microsoft.com/steverac/2010/12/04/focusing-on-the-printer-printer-monitoring-mp-supplement/</a></p> <p>&nbsp;</p> <p>In summary: </p> <p><em>“</em><em><strong>Printer MP Supplement <br></strong>The focus for building out this MP supplement was to offer individualized printer monitoring.&nbsp; Further, monitoring should include the ability to detect the 12 error conditions available from the printer MP in the catalog and each error condition should be configurable as to whether or not it is enabled and, if so, how long the error condition should persist before considering it to be a problem.&nbsp; Lets walk through the MP.” –Steve</em></p> <p>&nbsp;</p> <p>Introducing the “Tasty Printer Monitoring” management pack. I made a few changes and improvements. I streamlined the discovery scripts for the Printer and Print Server (role and server) classes. There are now only 3 scripts (1 for printers, 1 for print server roles, 1 for print servers)&nbsp; instead of an individual script for each OS version role and each OS version server. I cleaned up a few little things and renamed the MP so this is not an “update” to the original management pack. This is technically a different pack. You would not want to use both this pack and the original. If this new one meets your needs then you should remove the older pack. All of the Printer Role discoveries are enabled by default (2003, 2008, 2012, 2016).</p> <p>&nbsp;</p> <p>Here are a few screenshots from my lab. I don’t have many printers so I had to manipulate my lab for these screenshots so that even the non-shared printers were discovered. THIS IS ONLY FOR THESE EXAMPLE SCREENSHOTS. Only your <strong><u>shared</u></strong> printers will be discovered. </p> <p>&nbsp;</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/04/AllPrinterServersState1.jpg"><img title="AllPrinterServersState1" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="AllPrinterServersState1" src="https://msdnshared.blob.core.windows.net/media/2017/04/AllPrinterServersState1_thumb.jpg" width="930" height="556"></a></p> <p>&nbsp;</p> <p><strong>This is just an example of my lab where I enabled the discovery of the non-shared printers for demonstration purposes only.</strong> </p> <p>Normally your standard printer types would not be discovered (“Microsoft Print to PDF”, “Microsoft XPS Document Writer”, “Fax”, etc.)</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/04/AllPrintersState1.jpg"><img title="AllPrintersState1" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="AllPrintersState1" src="https://msdnshared.blob.core.windows.net/media/2017/04/AllPrintersState1_thumb.jpg" width="951" height="608"></a></p> <p>&nbsp;</p> <p><a href="https://gallery.technet.microsoft.com/scriptcenter/SCOM-Printer-Management-6926e538" target="_blank">DOWNLOAD</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>