Archive for October, 2014

I’ve seen a lot of posts on the Internet describing how you can use Orchestrator to trigger a Runbook when a condition is met. For example, Orchestrator can poll SCOM for a specific event and when it occurs it can trigger a Runbook . But what about when you want to trigger a Runbook from a different source? So today I took a look at how I could use PowerShell to trigger a Runbook. Now I have seen some posts describing how to extract the GUID of a Runbook and use that to start the Runbook. I’m not going to do that, I’m going to start a Runbook using only the name of the Runbook which I think is much easier for people to identify with a name, not a GUID. But hey, if you want to use the GUID, feel free to skip the rest of my post and head off to an example from Microsoft here: http://msdn.microsoft.com/en-us/library/hh921685.aspx.

Read more

In a recent script I wanted to find out the path to one of the special folders in Windows. Special folders are system folders like “Windows”, “System”, “Desktop”, “MyDocuments” and so on.

Well that’s pretty easy, you can simply use the following line:

[Environment+SpecialFolder]::GetNames([Environment+SpecialFolder])

And from the output you’ll see what SpecialFolders are on your system.

SpecialFolders

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now this is nice but it doesn’t show you where these SpecialFolders are, it just shows the name of them. So try this instead.
$SpecialFolders = @{}
$names = [Environment+SpecialFolder]::GetNames([Environment+SpecialFolder])

foreach($name in $names | sort Name)
{
if($path = [Environment]::GetFolderPath($name))
{
$SpecialFolders[$name] = $path
}
}

 

Now you’ll get a path as well 🙂

SpecialFolders2

 

 

 

 

We needed to make life a little easier for some of our new admins that need to seal some management packs. Ordinarily you’d open up a command prompt and run something like this.

cd “M:\SCOM 2012 R2\SupportTools\AMD64”
./MPSeal.exe “M:\Name of Management Pack.xml” /I “M:\Path to Referenced MP’s” /Outdir “M:\Output Directory” /Keyfile “M:\Seal Tools\mykey.snk” /Company “Your Company Name”

This would use the MPSeal.exe file from the Installation Media and seal an XML Management Pack using the appropriate information provided.

Now that’s ok, but let’s wrap it up in a little bit of PowerShell.

Read more

The SCOM Community is a pretty small group, but there’s always someone out there willing to help which is one of the reasons I enjoy this product so much. There are a few guys out there that have written daily checks for SCOM and they are incredibly useful…so I decided that I would share my own personal version with the world. I’ve gotten inspiration from other guys scripts over the years so credit where it’s due and I’ve tried to mention those people by name where possible.  Feel free to modify it for your own use.

If there is anything else you’d like to see in this report, drop me a line and I’ll see what I can do.

 

What can this report tell you?

  • Your Operational Database & Data Warehouse Servers…how much space they are using, free space, file sizes and locations.
  • The Reporting Server and Web Console Server URL’s and if they are OK.
  • Your Management Server Health, Versions, Server Uptime & the number of Workflows they are running.
  • How many Open Alerts, Groups, Monitors, Rules and State Changes
  • Which Management Packs have been modified in the last 24 Hours.
  • If there are any Overrides in the ‘Default Management Pack’
  • What Agents are in an Uninitialized State.
  • How many Pending Agents you have and in what state they are currently.
  • The number of Open Alerts you have and how many in the last 24 Hours.
  • The Alerts with a Repeat Count higher than a specific value which you choose.
  • If the Action Account has Local Administrator Permissions.
  • What Objects are in Maintenance.
  • Summary of Database Grooming Jobs in the last 24 hours.
  • Validation of your Global SCOM Settings…use this to see if any settings have been changed!

 

Read more