SCOM 2012 – SCOM Console Parameters How-To

Did you know that the SCOM console has also parameters you can add? Well it is nothing new because they were also available in SCOM 2007 R2 but I think it is also worth a post to show how it works and how to get the necessary information.

In SCOM 2012 the executable which is being used to launch the SCOM 2012 console rests in the “C:\Program Files\System Center 2012\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe” path.

If you call this executable in the command shell together with /? you will face this dialog.

image

/Clearcache:

I think the most common option is /clearcache in the older SCOM version it was sometimes necessary to add this switch in order to clean the console cache if you had stale data. In SCOM 2012 you also can add this switch to your console link. I haven’t met any needs so far for using this in SCOM 2012 but good to know.

image

There is a article on TechNet about when and how to use this switch.

/Server:

If you intend to connect to a specific management server this option will help. Lets assume need to connect to server SCOM02 your command will look like this:

“C:\Program Files\System Center 2012\Operations Manager\Console\
Microsoft.EnterpriseManagement.Monitoring.Console.exe”
/Server:SCOM02

Of course you could also modify the OperationsManager shortcut  for connecting always to a dedicated management server.

/Viewname:

This parameter is used to display just a view in a “full/only view scenario”. You might have a monitoring screen and therefore a dedicated computer. What you could do now is to make a batch which will after every reboot call a command to start a certain view. There are maybe more scenarios but I hope you get the idea Smile.

How do you get the view name? Well, I like to use Powershell for this:

#Import the SCOM Powershell module
Import-Module OperationsManager

#Create a connection to the management server “scom01”
$conn= New-SCOMManagementGroupConnection –ComputerName scom01

#Get the management group object
$mg=Get-SCOMManagementGroup

#Get the views and filter it to the view you need, here “DemoDA”
$mg.GetMonitoringViews() | where {$_.displayname -like “*Demo DA*”} | select Name

If you have your own view created you will receive something like…

View_af1ccd2497534879847dcf3e7526d8df

This will present the internal name of the view and this is what you need to complete the syntax. Now you are ready to complete your command. Open a command prompt and enter the command according to your results. In my case it would be like this…

“C:\Program Files\System Center 2012\Operations Manager\Console\
Microsoft.EnterpriseManagement.Monitoring.Console.exe”
/Viewname:View_af1ccd2497534879847dcf3e7526d8df

After entering this command the SCOM console will start and only your view will be presented.

view

/ManagementPack:

The management pack switch can only be used in conjunction with /Taskname or /Viewname. There might be a case when you need to provide a management pack for either one of these two parameters /Viewname or /Taskname.

How do I get parameters? Well again using Powershell:

#Import the SCOM Powershell module
Import-Module OperationsManager

#Create a connection to the management server “scom01”
$conn= New-SCOMManagementGroupConnection –ComputerName scom01

#Get the management group object
$mg=Get-SCOMManagementGroup

Because you need the internal name of the view, the display name and the management pack we slightly modified the command from above…

#Get the “All Performance Data” views and select name, display name and management pack
$mg.GetMonitoringViews() | where {$_.displayname -like “*All Perfor*”} | select Name,DisplayName,ManagementPack | ft –auto

The output…

image

Now your command will look like this…

“C:\Program Files\System Center 2012\Operations Manager\Console\
Microsoft.EnterpriseManagement.Monitoring.Console.exe”
/Viewname:Microsoft.SQLServer.ServerRole.AllPerformanceData.View
/ManagementPack:Microsoft.SQLServer.Library

image

/Taskname: and /TaskTarget:

An interesting option is /Taskname: together with /TaskTarget: in this scenario you could launch a specific task against a specific target. In my case I want to launch a task which will show me the network shares on my Node01 computer.

First I have to identify the task name. This is done by calling the following steps in Powershell.

#Import the SCOM Powershell module
Import-Module OperationsManager

#Create a connection to the management server “scom01”
$conn= New-SCOMManagementGroupConnection –ComputerName scom01

#Get the management group object
$mg=Get-SCOMManagementGroup

#Get the monitoring task name
$mg.GetMonitoringTasks() | where {$_.displayname -like “*Display Network Shares*”} |   select Name

This will return the internal name of the task…

Microsoft.Windows.Server.2008.Computer.NetworkShareQuery.Task

#Get the ID of the target computer, here “Node01”
Get-SCOMAgent | where {$_.Displayname -like “*Node01*”} | select ID

This returns the ID of the computer which we will use as target…

5e211fb5-68a2-9212-25b0-5ae753310288

The final command looks like this…

“C:\Program Files\System Center 2012\Operations Manager\Console\
Microsoft.EnterpriseManagement.Monitoring.Console.exe”
/TaskName:Microsoft.Windows.Server.2008.Computer.NetworkShareQuery.Task
/TaskTarget:5e211fb5-68a2-9212-25b0-5ae753310288

Now we are ready to fire this puppy up, the console opens and click “Run”…

image

…and runs successfully.

image

Note:

If you want to execute the commands you have to choices first you start it in regular command prompt (cmd.exe) as I normally do or if you want to execute it in Powershell you need to execute the command using Invoke-Expression.

Here an example:

Invoke-Expression -command 
“&`”C:\Program Files\System Center 2012\Operations Manager\Console\
Microsoft.EnterpriseManagement.Monitoring.Console.exe`”
/Viewname:Microsoft.SQLServer.ServerRole.AllPerformanceData.View
/ManagementPack:Microsoft.SQLServer.Library”

Let me know if you have any cool ideas where you are using these command line switches.

Have fun…

5 Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s