<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SCOM:  Automatically Starting Maintenance Mode When Servers are Rebooted for Patching</title>
	<atom:link href="http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/feed/" rel="self" type="application/rss+xml" />
	<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/</link>
	<description>Living in the I.T. Operating Quadrant. Useful articles on real world solutions involving Monitoring (System Center Operations Manager), Virtualization, Reporting, Scripting (PowerShell), and much more.</description>
	<lastBuildDate>Tue, 01 May 2012 11:20:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: sorendk</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1971</link>
		<dc:creator><![CDATA[sorendk]]></dc:creator>
		<pubDate>Tue, 01 May 2012 11:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1971</guid>
		<description><![CDATA[Now I have made the best way to put server in Automatically Maintenance Mode When Servers are Rebooted for Patching. If you ask me :-)


It set the server in Maintenance Mode just before start installing updates, and when the server has rebootet and up running, it stops Maintenance Mode.

Our helpdesk is so happy now, the only see things which are error after patchning, not windows services down, then updates ISS and SQL and so on.



Made this on you RMS server

1. Create a  Subscription / monitor System EVENT ID 18 Source: contains Update.

Alert description 
$Target/Property[Type=&quot;Windows1!Microsoft.Windows.Computer&quot;]/PrincipalName$
$Data/Context/EventDescription$
Preparing for security later to day.


2. Then a channel  
D:\xxxxxx_auto\xxxxxx_WSUS_MAINT.REXX $Data/Context/DataItem/AlertDescription$


3. Then a Rexx file (use something else if you want)

/* REXX */
/* Program provides a command to put servers in maintenance mode at specific time */
/* ifm. installation of security updates.    event 18 from systemlog                       */

arg parmstr


logfil      = &#039;D:\xxxxxx_auto\logs\&#039;date(I)&#039;-wsus-maint-input.txt&#039; /* what is called program       */
logfil2     = &#039;D:\xxxxxx_auto\wsus-timer.cmd&#039;                      /* commands to the scheduled task */
skipfil     = &#039;D:\xxxxxx_auto\logs\&#039;date(I)&#039;-wsus-maint-skip.txt&#039;  /* errors in the input log here       */  

&#039;@echo &#039;time() &#039;&quot;&#039;parmstr&#039;&quot; &gt;&gt; &#039;logfil

  /*-------------------------------------------------*/
  /* valider input - exit If the input is not correct */
  /*-------------------------------------------------*/
  if pos(&#039;THESE UPDATES ON&#039;,parmstr) = &#039;0&#039; then ,
    do
     &#039;@echo &#039;parmstr&#039; &gt;&gt; &#039; skipfil
     exit
    end


parse value parmstr with servernavn r2 &#039;THESE UPDATES ON&#039; datoen &#039; AT &#039; klokken r3





parse value datoen with dd &#039;.&#039; maaned aaaa


/*---------------------------------------------------------------------------------------------------------------*/
/* Validate the content and length on the date fields                                                             */
/*---------------------------------------------------------------------------------------------------------------*/

  dd = strip(dd) 
  if pos(&#039;?&#039;,dd)  &#039;0&#039; then dd = strip(dd,,&#039;?&#039;)
   if length(dd) &lt; &#039;2&#039; then dd = &#039;0&#039;dd

  if pos(&#039;?&#039;,maaned)  &#039;0&#039; then maaned = strip(maaned,,&#039;?&#039;)

  if pos(&#039;?&#039;,aaaa)  &#039;0&#039; then aaaa = strip(aaaa,,&#039;?&#039;)

/*---------------------------------------------------------------------------------------------------------------*/
/* When the scheduled task must be created with month as the number we just convert from name to number         */
/*---------------------------------------------------------------------------------------------------------------*/
 
if substr(maaned,1,3) = &#039;JAN&#039;  then maaned = &#039;01&#039;
if substr(maaned,1,3) = &#039;FEB&#039;  then maaned = &#039;02&#039;
if substr(maaned,1,3) = &#039;MAR&#039;  then maaned = &#039;03&#039;
if substr(maaned,1,3) = &#039;APR&#039;  then maaned = &#039;04&#039;
if substr(maaned,1,2) = &#039;MA&#039;   then maaned = &#039;05&#039;
if substr(maaned,1,3) = &#039;JUN&#039;  then maaned = &#039;06&#039;
if substr(maaned,1,3) = &#039;JUL&#039;  then maaned = &#039;07&#039;
if substr(maaned,1,3) = &#039;AUG&#039;  then maaned = &#039;08&#039;
if substr(maaned,1,3) = &#039;SEP&#039;  then maaned = &#039;09&#039;
if substr(maaned,1,1) = &#039;O&#039;    then maaned = &#039;10&#039;
if substr(maaned,1,3) = &#039;NOV&#039;  then maaned = &#039;11&#039;
if substr(maaned,1,3) = &#039;DEC&#039;  then maaned = &#039;12&#039;


klokken = substr(klokken,1,5)
dato    = maaned&#039;/&#039;strip(dd)&#039;/&#039;strip(aaaa)

taskid = servernavn
if pos(&#039;.&#039;,taskid)  &#039;0&#039; then parse value taskid with taskid &#039;.&#039; rst_tsk

servernavn = strip(servernavn)

/*say taskid servernavn dato klokken*/

/*-------------------------------------------------------*/
/* write to the file later executed by the scheduled task */
/*-------------------------------------------------------*/
&#039;@echo cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#039; taskid servernavn klokken dato &#039; &gt;&gt; &#039; logfil2 

/*-----------------------------------------------------------------------------------------------------------------------------*/
/* If the domain controllers, there may come alarms on the running far can not see it there is to be restarted                * /
/ * These alarms bother we do not see, so we put also &quot;his partner&quot; in maintenance mode                                        */
/*-----------------------------------------------------------------------------------------------------------------------------*/

 partner_server = &#039;&#039;

  select
    /*---------------------------------------------*/
    /* xx.DK                                      */
    /*---------------------------------------------*/
    when servernavn = &#039;xx-DC4.xx.DK&#039; then ,
       do
         partner_server = &#039;xx-DC5.xx.DK&#039;
         partner_taskid = &#039;xx-DC5&#039;
       end
    when servernavn = &#039;xx-DC5.xx.DK&#039; then ,
       do
         partner_server = &#039;xx-DC4.xx.DK&#039;
         partner_taskid = &#039;x-DC4&#039;
       end 

    /*---------------------------------------------*/
    /* yy.xx.DK                                    */
    /*---------------------------------------------*/
    when servernavn = &#039;ADMIN-DC02.yy.xx.DK&#039; then ,
       do
         partner_server = &#039;ADMIN-DC3.yy.xx.DK.DK&#039;
         partner_taskid = &#039;ADMIN-DC3&#039;
       end
    when servernavn = &#039;ADMIN-DC3..yy.xx.DK&#039; then ,
       do
         partner_server = &#039;ADMIN-DC02..yy.xx.DK.DK&#039;
         partner_taskid = &#039;ADMIN-DC02&#039;
       end 

   otherwise
     do
        nop
     end
  end 

/*-------------------------------------------------------*/
/* write to the file later executed by the scheduled task */
/*-------------------------------------------------------*/
  if partner_server  &#039;&#039; then ,
    do
       &#039;@echo cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#039; partner_taskid partner_server klokken dato &#039; &gt;&gt; &#039; logfil2 

    end


/*&#039;@start cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#039; taskid servernavn klokken dato */

/*&#039;@echo &#039;time() taskid servernavn klokken dato&#039; &gt;&gt; &#039; logfil */

 

exit



4. Then a Cmd file call AMM_OPRET_SCHTASK.cmd


@echo off
rem ......................................................................
rem .      This program will create a schedule task                       .
rem .      Run the program with the parameter.				  .
rem .      Parameter 1 is what you want the task to be named.		  .
rem .      Parameter 2 is the full server name.				  .
rem .      Parameter 3 is the time when the server in maintenance mode.   .
rem .	   Parameter 4 is the date in mm/dd/åååå 								 .
rem ......................................................................

schtasks /create /RU xxxx\SCOM_scheduler /RP PASSWORD /SC ONCE /TN xxxxxx_AMM_%1 /TR &quot;C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe D:\xxxxxx_auto\AgentMaintenanceModeV4.ps1 -rootMS: &#039;xx-rms01&#039; -computerPrincipalName: &#039;%2&#039; -minutes:30 -Comment: &#039;Server is being patched&#039; -reason: &#039;PlannedOther&#039;&quot; /ST %3 /SD %4 /V1 /F /RL HIGHEST /Z


5. Then a empty Cmd file call wsus-timer.cmd


6. Then a Cmd file call wsus-timer-admin.cmd

cmd /c d:\xxxxxx_auto\wsus-timer.cmd
del /q d:\xxxxxx_auto\wsus-timer.cmd
echo rem &gt;&gt; d:\xxxxxx_auto\wsus-timer.cmd


7. Then a Schedule task as call wsus-timer-admin.cmd once per hour.



Good luck]]></description>
		<content:encoded><![CDATA[<p>Now I have made the best way to put server in Automatically Maintenance Mode When Servers are Rebooted for Patching. If you ask me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>It set the server in Maintenance Mode just before start installing updates, and when the server has rebootet and up running, it stops Maintenance Mode.</p>
<p>Our helpdesk is so happy now, the only see things which are error after patchning, not windows services down, then updates ISS and SQL and so on.</p>
<p>Made this on you RMS server</p>
<p>1. Create a  Subscription / monitor System EVENT ID 18 Source: contains Update.</p>
<p>Alert description<br />
$Target/Property[Type="Windows1!Microsoft.Windows.Computer"]/PrincipalName$<br />
$Data/Context/EventDescription$<br />
Preparing for security later to day.</p>
<p>2. Then a channel<br />
D:\xxxxxx_auto\xxxxxx_WSUS_MAINT.REXX $Data/Context/DataItem/AlertDescription$</p>
<p>3. Then a Rexx file (use something else if you want)</p>
<p>/* REXX */<br />
/* Program provides a command to put servers in maintenance mode at specific time */<br />
/* ifm. installation of security updates.    event 18 from systemlog                       */</p>
<p>arg parmstr</p>
<p>logfil      = &#8216;D:\xxxxxx_auto\logs\&#8217;date(I)&#8217;-wsus-maint-input.txt&#8217; /* what is called program       */<br />
logfil2     = &#8216;D:\xxxxxx_auto\wsus-timer.cmd&#8217;                      /* commands to the scheduled task */<br />
skipfil     = &#8216;D:\xxxxxx_auto\logs\&#8217;date(I)&#8217;-wsus-maint-skip.txt&#8217;  /* errors in the input log here       */  </p>
<p>&#8216;@echo &#8216;time() &#8216;&#8221;&#8216;parmstr&#8217;&#8221; &gt;&gt; &#8216;logfil</p>
<p>  /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
  /* valider input &#8211; exit If the input is not correct */<br />
  /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
  if pos(&#8216;THESE UPDATES ON&#8217;,parmstr) = &#8217;0&#8242; then ,<br />
    do<br />
     &#8216;@echo &#8216;parmstr&#8217; &gt;&gt; &#8216; skipfil<br />
     exit<br />
    end</p>
<p>parse value parmstr with servernavn r2 &#8216;THESE UPDATES ON&#8217; datoen &#8216; AT &#8216; klokken r3</p>
<p>parse value datoen with dd &#8216;.&#8217; maaned aaaa</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
/* Validate the content and length on the date fields                                                             */<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/</p>
<p>  dd = strip(dd)<br />
  if pos(&#8216;?&#8217;,dd)  &#8217;0&#8242; then dd = strip(dd,,&#8217;?')<br />
   if length(dd) &lt; &#039;2&#039; then dd = &#039;0&#039;dd</p>
<p>  if pos(&#039;?&#039;,maaned)  &#8217;0&#8242; then maaned = strip(maaned,,&#8217;?')</p>
<p>  if pos(&#8216;?&#8217;,aaaa)  &#8217;0&#8242; then aaaa = strip(aaaa,,&#8217;?')</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
/* When the scheduled task must be created with month as the number we just convert from name to number         */<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/</p>
<p>if substr(maaned,1,3) = &#8216;JAN&#8217;  then maaned = &#8217;01&#8242;<br />
if substr(maaned,1,3) = &#8216;FEB&#8217;  then maaned = &#8217;02&#8242;<br />
if substr(maaned,1,3) = &#8216;MAR&#8217;  then maaned = &#8217;03&#8242;<br />
if substr(maaned,1,3) = &#8216;APR&#8217;  then maaned = &#8217;04&#8242;<br />
if substr(maaned,1,2) = &#8216;MA&#8217;   then maaned = &#8217;05&#8242;<br />
if substr(maaned,1,3) = &#8216;JUN&#8217;  then maaned = &#8217;06&#8242;<br />
if substr(maaned,1,3) = &#8216;JUL&#8217;  then maaned = &#8217;07&#8242;<br />
if substr(maaned,1,3) = &#8216;AUG&#8217;  then maaned = &#8217;08&#8242;<br />
if substr(maaned,1,3) = &#8216;SEP&#8217;  then maaned = &#8217;09&#8242;<br />
if substr(maaned,1,1) = &#8216;O&#8217;    then maaned = &#8217;10&#8242;<br />
if substr(maaned,1,3) = &#8216;NOV&#8217;  then maaned = &#8217;11&#8242;<br />
if substr(maaned,1,3) = &#8216;DEC&#8217;  then maaned = &#8217;12&#8242;</p>
<p>klokken = substr(klokken,1,5)<br />
dato    = maaned&#8217;/'strip(dd)&#8217;/'strip(aaaa)</p>
<p>taskid = servernavn<br />
if pos(&#8216;.&#8217;,taskid)  &#8217;0&#8242; then parse value taskid with taskid &#8216;.&#8217; rst_tsk</p>
<p>servernavn = strip(servernavn)</p>
<p>/*say taskid servernavn dato klokken*/</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
/* write to the file later executed by the scheduled task */<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
&#8216;@echo cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#8217; taskid servernavn klokken dato &#8216; &gt;&gt; &#8216; logfil2 </p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*/<br />
/* If the domain controllers, there may come alarms on the running far can not see it there is to be restarted                * /<br />
/ * These alarms bother we do not see, so we put also &#8220;his partner&#8221; in maintenance mode                                        */<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*/</p>
<p> partner_server = &#8221;</p>
<p>  select<br />
    /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
    /* xx.DK                                      */<br />
    /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
    when servernavn = &#8216;xx-DC4.xx.DK&#8217; then ,<br />
       do<br />
         partner_server = &#8216;xx-DC5.xx.DK&#8217;<br />
         partner_taskid = &#8216;xx-DC5&#8242;<br />
       end<br />
    when servernavn = &#8216;xx-DC5.xx.DK&#8217; then ,<br />
       do<br />
         partner_server = &#8216;xx-DC4.xx.DK&#8217;<br />
         partner_taskid = &#8216;x-DC4&#8242;<br />
       end </p>
<p>    /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
    /* yy.xx.DK                                    */<br />
    /*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
    when servernavn = &#8216;ADMIN-DC02.yy.xx.DK&#8217; then ,<br />
       do<br />
         partner_server = &#8216;ADMIN-DC3.yy.xx.DK.DK&#8217;<br />
         partner_taskid = &#8216;ADMIN-DC3&#8242;<br />
       end<br />
    when servernavn = &#8216;ADMIN-DC3..yy.xx.DK&#8217; then ,<br />
       do<br />
         partner_server = &#8216;ADMIN-DC02..yy.xx.DK.DK&#8217;<br />
         partner_taskid = &#8216;ADMIN-DC02&#8242;<br />
       end </p>
<p>   otherwise<br />
     do<br />
        nop<br />
     end<br />
  end </p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
/* write to the file later executed by the scheduled task */<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*/<br />
  if partner_server  &#8221; then ,<br />
    do<br />
       &#8216;@echo cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#8217; partner_taskid partner_server klokken dato &#8216; &gt;&gt; &#8216; logfil2 </p>
<p>    end</p>
<p>/*&#8217;@start cmd.exe /c d:\xxxxxx_auto\AMM_OPRET_SCHTASK.CMD&#8217; taskid servernavn klokken dato */</p>
<p>/*&#8217;@echo &#8216;time() taskid servernavn klokken dato&#8217; &gt;&gt; &#8216; logfil */</p>
<p>exit</p>
<p>4. Then a Cmd file call AMM_OPRET_SCHTASK.cmd</p>
<p>@echo off<br />
rem &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
rem .      This program will create a schedule task                       .<br />
rem .      Run the program with the parameter.				  .<br />
rem .      Parameter 1 is what you want the task to be named.		  .<br />
rem .      Parameter 2 is the full server name.				  .<br />
rem .      Parameter 3 is the time when the server in maintenance mode.   .<br />
rem .	   Parameter 4 is the date in mm/dd/åååå 								 .<br />
rem &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>schtasks /create /RU xxxx\SCOM_scheduler /RP PASSWORD /SC ONCE /TN xxxxxx_AMM_%1 /TR &#8220;C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe D:\xxxxxx_auto\AgentMaintenanceModeV4.ps1 -rootMS: &#8216;xx-rms01&#8242; -computerPrincipalName: &#8216;%2&#8242; -minutes:30 -Comment: &#8216;Server is being patched&#8217; -reason: &#8216;PlannedOther&#8217;&#8221; /ST %3 /SD %4 /V1 /F /RL HIGHEST /Z</p>
<p>5. Then a empty Cmd file call wsus-timer.cmd</p>
<p>6. Then a Cmd file call wsus-timer-admin.cmd</p>
<p>cmd /c d:\xxxxxx_auto\wsus-timer.cmd<br />
del /q d:\xxxxxx_auto\wsus-timer.cmd<br />
echo rem &gt;&gt; d:\xxxxxx_auto\wsus-timer.cmd</p>
<p>7. Then a Schedule task as call wsus-timer-admin.cmd once per hour.</p>
<p>Good luck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bradje</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1795</link>
		<dc:creator><![CDATA[bradje]]></dc:creator>
		<pubDate>Tue, 31 Jan 2012 01:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1795</guid>
		<description><![CDATA[Hi Mike,
Under Administration/Notification/Channels, right-click/New Channel/Command
John Bradshaw]]></description>
		<content:encoded><![CDATA[<p>Hi Mike,<br />
Under Administration/Notification/Channels, right-click/New Channel/Command<br />
John Bradshaw</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SorenDK</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1625</link>
		<dc:creator><![CDATA[SorenDK]]></dc:creator>
		<pubDate>Wed, 23 Nov 2011 06:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1625</guid>
		<description><![CDATA[The event 22 contains Update is Windows Update, there make this event, not SCCM. So check the event log, if there are a event in the log before the server reboot, and try to set it.]]></description>
		<content:encoded><![CDATA[<p>The event 22 contains Update is Windows Update, there make this event, not SCCM. So check the event log, if there are a event in the log before the server reboot, and try to set it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1529</link>
		<dc:creator><![CDATA[Ramesh]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 09:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1529</guid>
		<description><![CDATA[We are using SCCM Maintenance Window option to reboot servers after the patches are installed. I doubt if there is an event that gets logged in the eventlog when SCCM client is entering the MW period. If such event is logged, then we can capture that event for SCOM MM monitor that would run the above PS script. 

Did anyone find a way to put servers in SCOM MM when servers are being rebooted during SCCM MW?]]></description>
		<content:encoded><![CDATA[<p>We are using SCCM Maintenance Window option to reboot servers after the patches are installed. I doubt if there is an event that gets logged in the eventlog when SCCM client is entering the MW period. If such event is logged, then we can capture that event for SCOM MM monitor that would run the above PS script. </p>
<p>Did anyone find a way to put servers in SCOM MM when servers are being rebooted during SCCM MW?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike G</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1510</link>
		<dc:creator><![CDATA[Mike G]]></dc:creator>
		<pubDate>Tue, 27 Sep 2011 04:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1510</guid>
		<description><![CDATA[Newbie here....
Can&#039;t get past this stage
&quot;Create a new notification recipient using the command notification channel&quot;, I can&#039;t find where to start this. 
Please help :(]]></description>
		<content:encoded><![CDATA[<p>Newbie here&#8230;.<br />
Can&#8217;t get past this stage<br />
&#8220;Create a new notification recipient using the command notification channel&#8221;, I can&#8217;t find where to start this.<br />
Please help <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SorenDK</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1495</link>
		<dc:creator><![CDATA[SorenDK]]></dc:creator>
		<pubDate>Fri, 16 Sep 2011 07:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1495</guid>
		<description><![CDATA[I have made a little modification.

 A Subscription / monitor System EVENT ID 22 Source: contains Update.

And now 10 minutes maintenance mode, I had some servers that come with alarms, before the servers where put in to maintenance mode.

Hope it better. :-)]]></description>
		<content:encoded><![CDATA[<p>I have made a little modification.</p>
<p> A Subscription / monitor System EVENT ID 22 Source: contains Update.</p>
<p>And now 10 minutes maintenance mode, I had some servers that come with alarms, before the servers where put in to maintenance mode.</p>
<p>Hope it better. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Bradshaw</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1494</link>
		<dc:creator><![CDATA[John Bradshaw]]></dc:creator>
		<pubDate>Fri, 16 Sep 2011 00:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1494</guid>
		<description><![CDATA[Hi Soren,
Working well....thx
JB]]></description>
		<content:encoded><![CDATA[<p>Hi Soren,<br />
Working well&#8230;.thx<br />
JB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mats Augustsson</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1489</link>
		<dc:creator><![CDATA[Mats Augustsson]]></dc:creator>
		<pubDate>Wed, 14 Sep 2011 14:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1489</guid>
		<description><![CDATA[Hi Luca!

I didn&#039;t get your script to work. Can you send me your script and description to mats.augustsson@lumagate.se.]]></description>
		<content:encoded><![CDATA[<p>Hi Luca!</p>
<p>I didn&#8217;t get your script to work. Can you send me your script and description to <a href="mailto:mats.augustsson@lumagate.se">mats.augustsson@lumagate.se</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mats Augustsson</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1488</link>
		<dc:creator><![CDATA[Mats Augustsson]]></dc:creator>
		<pubDate>Wed, 14 Sep 2011 14:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1488</guid>
		<description><![CDATA[Hi Fabia!

I&#039;m interesting to how you solved to put Health Services Watcher inot MM.
It should help me a lot if you can send me send your lines. My email address is mats.augustsson@lumagate.se]]></description>
		<content:encoded><![CDATA[<p>Hi Fabia!</p>
<p>I&#8217;m interesting to how you solved to put Health Services Watcher inot MM.<br />
It should help me a lot if you can send me send your lines. My email address is <a href="mailto:mats.augustsson@lumagate.se">mats.augustsson@lumagate.se</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Bradshaw</title>
		<link>http://operatingquadrant.com/2009/08/15/scom-automatically-starting-maintenance-mode-when-servers-are-rebooted-for-patching/#comment-1487</link>
		<dc:creator><![CDATA[John Bradshaw]]></dc:creator>
		<pubDate>Wed, 14 Sep 2011 00:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://operatingquadrant.com/?p=81#comment-1487</guid>
		<description><![CDATA[Yep...
Get an alert from the Event Create Rule......Then set up your Subscription and choose for Criteria...&quot;created by specific rules or monitors&quot;. Choose the rule you just created.

Works well for a sinle machine....still working on getting it going for multiple machines. See Powershell from Soren above.

mail me at jDOTbradshawATunswDOTeduDOTau if that is not clear.]]></description>
		<content:encoded><![CDATA[<p>Yep&#8230;<br />
Get an alert from the Event Create Rule&#8230;&#8230;Then set up your Subscription and choose for Criteria&#8230;&#8221;created by specific rules or monitors&#8221;. Choose the rule you just created.</p>
<p>Works well for a sinle machine&#8230;.still working on getting it going for multiple machines. See Powershell from Soren above.</p>
<p>mail me at jDOTbradshawATunswDOTeduDOTau if that is not clear.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

