Browsed by
Month: November 2015

SCOM Maintenance Mode for Windows Cluster

SCOM Maintenance Mode for Windows Cluster

You may already use some scripts to put Windows servers in maintenance mode, but sometimes you need to handle the fact that targeted Windows computers are part of a Windows cluster. In this case, you will need put all of the cluster objects in maintenance mode otherwise, SCOM will generate an alert (by default) for network, disks, etc.

So, I wrote a little PowerShell script to check if a Windows computer is part of a Windows cluster in SCOM, and put all related objects in maintenance mode.

Parameters

The script accepts five parameters: objectName, maintenanceType, description, duration and managementServer.

objectName
The FQDN of the SCOM Windows Computer in the SCOM Management Group that you want to put in maintenance mode.

maintenanceType
The type of maintenance based on what you can find in the console.

description
The description that explains the reason for maintenance mode.

duration
The duration time in minutes of maintenance mode.

managementServer
The FQDN of the SCOM Management Server that you want to launch maintenance mode.

Usage

 
You can retrieve and download this script directly on TechNet gallery here.

How to Add Overridable Parameters to a SCOM Monitor Type

How to Add Overridable Parameters to a SCOM Monitor Type

When you create a monitor unit in SCOM you need to specify a monitor type that defines the schema, operation, parameters of the monitor. But sometimes you need more parameters or functionalities than default monitor types provided by Microsoft for example.

In this case, a client needed the possibility to override thresholds values of a custom management pack monitor directly from the console. At first, it was not possible because the monitor was based on standard Microsoft monitor type: Microsoft.Windows.TimedScript.ThreeStateMonitorType. This monitor type as indicated by his name is a three state monitor used to run a script against a specific target to retrieve specific values. Additionally, this monitor type is based on the standard data source module type Microsoft.Windows.TimedScript.PropertyBagProvider.

In order to add the possibility to override threshold values of this monitor, the only solution was to rewrite the data source module type and the monitor type. In this example, we will see how to add a warning and critical overridable parameters.

So first, you’ll need to write your own data source module type. In this case, the easiest way to handle that is to copy/paste source code of the original data source and add parameters that you want to override. As you can see below, I added my two parameters (Warning Threshold, Critical Threshold) to the configuration schema and overridable parameters blocks.

Then, you need to create your monitor type that will use this data source module type. As this monitor type is also based on an existing monitor type, just copy/paste source code. And as for the data source module type, you will need to add your parameters to the configuration schema and overridable parameters blocks.

Then, you’ll need to call the data source module type that we created and build your conditions detection depending your needs. In this case, it is a three state monitor based on a script, so you need to create 3 condition detection based on your parameters. For this monitor type, the configuration of conditions is:

  • Healthy, when the value of the property named Value in the script will be greater than the value of the Warning Threshold parameter.
  • Warning, when the value of the property named Value in the script will be less or equal than the value of the Warning Threshold parameter AND when the value of the property named Value in the script will greater than the value of the Critical Threshold parameter.
  • Critical, when the value of the property named Value in the script will be less or equal than the value of the Critical Threshold parameter.

You can see a part of the configuration in the picture below. Just for information, you can also define these expressions directly in the monitor rather than in the monitor type. It depends on your needs.

Finally, you can create your monitor based on your previously created monitor type id and define your overridable parameters.

You can then verify in SCOM that you can override your parameters directly from the console.

You can retrieve MP source code of this example here. Enjoy.

Error: SCOM Alerts Showing in a Different Language

Error: SCOM Alerts Showing in a Different Language

If you have SCOM agent all around the world, you will probably face this issue. Mostly for event monitor based, alert description field could be in a different language (non-English), even for OS installed with En-Us language settings.

To resolve this issue, you’ll need to modify some registry keys of your SCOM agent service account. By default, the account used by SCOM agent service is Local System (SID S-1-5-18).

Note
If you are not using Local System, you’ll need to find SID of your custom service account using this command:
wmic useraccount where name=’usernameofyourSCOMserviceaccount’ get sid

The keys you need to modify on each server where your encounter the issue are:

In addition, you can verify the keys for these accounts to have the same configuration:

  • Default, S-1-5-19 (Local Service Account)
  • S-1-5-20 (Network Service Account)
Warning
You will need to restart the computer (restart SCOM agent service is not enough) to apply changes and to receive new SCOM alerts in English.
System Center 2012 R2 – High Availability: Configuration Manager

System Center 2012 R2 – High Availability: Configuration Manager

To finish this series about how to implement each product of System Center 2012 R2 suite as highly available and how to backup & recover them, in this article we will focus on System Center Configuration Manager.

In order to make your Configuration Manager infrastructure highly available you will have to:

  • Deploy each Configuration Manager site database on a SQL Server failover cluster or highly available virtual machine
  • Deploy a hierarchy of sites, with CAS and multiple primary sites
  • Install multiple instances of the management point, distribution point, state migration point, system health validator point, application catalog web service point, software update point site system roles.
  • Install multiple instances of SMS Provider at each site.

Configuration Manager includes a backup maintenance task that runs on a schedule. It’s available on the Site Maintenance item on the ribbon, which you can open when you select the Sites node in the Administration workspace of the Configuration Manager console. The Configuration Manager Backup Site Server site maintenance task backs up the following:

  • Site database
  • Configuration Manager registry keys
  • Configuration Manager files and folders.

The backup site server scheduled maintenance task does not backup content files for software updates, applications, or operating system deployment. You should back up the SCCMContentLib folder on the Configuration Manager site server, using file backup to backup the content library. You will also need to ensure that you have taken a file backup of package source files.

In order to recover a site server, you can choose one of the following options:

  • Recover the site server using an existing backup. You can leverage this option if you have created a backup using the scheduled maintenance task.
  • Reinstall the site server. Only use this option if you don’t have a backup of the site server. When using this option, ensure that you use the same site code and site database name as the original site server.

It will be necessary to recover the Configuration Manager database if the database becomes corrupted or if the data is otherwise lost. If you are recovering a database in a hierarchy, any changes made to the site database since the backup will be retrieved from the central administration site if you are recovering a primary site database, or from a primary site database if you are recovering the central administration site. If you are recovering the database of a stand-alone primary site, all changes made subsequent to the backup will be lost.
When performing database recovery, you have the following recovery options:

  • Recover the site database using a backup set This option allows you to restore the database using the backup created using the scheduled maintenance task.
  • Use a site database that has been manually recovered You use this option if you use SQL Server Management Studio, DPM, or another tool to back up the Configuration Manager database.
  • Create a new database for this site Use this option if you do not have access to a backup of the Configuration Manager site database. This option is only available if the site is part of a Configuration Manager hierarchy. You cannot use this option to recover the site database of a CAS if no primary sites are present and you can’t use this option to recover the site database of a stand-alone primary site.

After performing site recovery, you will need to perform the following steps:

  • Reenter user account passwords. The final page of the recovery wizard will provide you with information about which accounts require password information. This information is also saved to the file C:\ConfigMgrPostRecoveryActions.html.
  • Reenter sideloading keys. If you have entered sideloading keys for software deployment to Windows 8 and Windows 8.1 devices, you must reenter these keys, as they will be reset during site recovery.
  • Configure SSL for site system roles that use IIS. You will also need to reconfigure IIS to use the appropriate SSL certificate for site system roles after performing recovery.
  • Recover custom reports. If you have custom Configuration Manager reports, you will need to recover these reports after performing site recovery.
  • Recover content files. You will need to recover content files to the same locations as they used on the site server prior to the failure that triggered the recovery process.
  • Update Microsoft Azure management certificates. If your organization uses Microsoft Azure for cloud-based distribution points, you will need to update these management certificates for the newly recovered site server.

If you need to recover a computer that hosts a Configuration Manager secondary site, ensure that you configure the computer with the same name as the original computer that hosted the secondary site. Recovery of a secondary site requires that the primary site server is available. Configuration Manager secondary sites aren’t backed up by scheduled maintenance tasks.