{"id":8178,"date":"2016-06-08T12:29:59","date_gmt":"2016-06-08T10:29:59","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/"},"modified":"2016-06-08T12:29:59","modified_gmt":"2016-06-08T10:29:59","slug":"scom-schedule-group-maintenance-task-with-powershell","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/","title":{"rendered":"SCOM: schedule group maintenance task with PowerShell"},"content":{"rendered":"<p>In my last blog post, <a href=\"http:\/\/dbi-services.com\/blog\/scom-change-group-state-to-maintenance-mode\/\">here<\/a>, I spoke about how to place SCOM group in maintenance mode. This script is really interesting with an integration in Windows Task Scheduler. At the end, the main purpose is to plan a maintenance window of our different servers.<\/p>\n<p>Let&#8217;s see how we can do that with PowerShell script.<\/p>\n<p>First, I try to use the cmdlet <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/jj649811%28v=wps.630%29.aspx\">Register-ScheduledTask<\/a>, which can be used to register a scheduled task definition on a local computer. But, I\u00a0quickly encountered a problem when I wanted to schedule my task every fourth Thursday of each month with the cmdlet\u00a0<a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/jj649821%28v=wps.630%29.aspx\">New-ScheduledTaskTrigger<\/a>. I was a little bit disappointed to see that it is not possible&#8230; Just daily and weekly recurring schedule are available&#8230; no monthly possibility&#8230; oups \ud83d\ude25<\/p>\n<p>After a small search on the web, I found what I was looking for. I will create a COM object with the &#8220;schedule.service&#8221; ProgID (Programmatic IDentifier). It is an older method than the first solution I found but it guaranteed the possibility to schedule my task as I want.<\/p>\n<p>First I need to provide some input parameters to my script:<\/p>\n<ul>\n<li>TaskName: mandatory parameter containing the name ot the scheduled task<\/li>\n<li>TaskDescr: mandatory parameter containing the description of the scheduled task<\/li>\n<li>ManagementServer: mandatory parameter containing management server name<\/li>\n<li>GroupName: mandatory parameter containing display name of the target group<\/li>\n<li>DurationTimeMin: mandatory parameter containing the duration maintenance time in minutes of the maintenance task<\/li>\n<li>Comment: mandatory parameter containing a comment for the maintenance task<\/li>\n<\/ul>\n<p>Of course, I could define more parameters. Please, feel free to add more parameters to this script, according to your needs.<br \/>\nWith PowerShell:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">param(\n[Parameter(Mandatory=$true)][string]\n$TaskName,\n[Parameter(Mandatory=$true)][string]\n$TaskDescr,\n[Parameter(Mandatory=$true)][string]\n$ManagementServer,\n[Parameter(Mandatory=$true)][string]\n$GroupName,\n[Parameter(Mandatory=$true)][string]\n$DurationTimeMin, \n[Parameter(Mandatory=$true)][string]\n$Comment\n)<\/pre>\n<p>Now, I create my new Com object:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\"># Attach the Task Scheduler com object\n$service = new-object -ComObject(\"Schedule.Service\")<\/pre>\n<p>I <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa381833(v=vs.85).aspx\">connect <\/a>it to my local machine:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\"># connect to the local machine.\n$service.Connect()\n$rootFolder = $service.GetFolder(\"\\\")<\/pre>\n<p>I define a new task which I enable, add my description coming from a parameter, allow to start my task on demand and enable the task as now:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">$TaskDefinition = $service.NewTask(0)\n$TaskDefinition.RegistrationInfo.Description = \"$TaskDescr\"\n$TaskDefinition.Settings.Enabled = $true\n$TaskDefinition.Settings.AllowDemandStart = $true\n# Time when the task starts\n$TaskStartTime = [datetime]::Now<\/pre>\n<p>My task will execute the script to set my SCOM group in maintenance mode. I will specify the path to my script, use PowerShell to execute my command and give arguments to my script:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\"># Task Action command\n$TaskCommand = \"powershell.exe\"\n# PowerShell script to be executed\n$TaskScript = \"C:\\powershell\\GroupMaintenanceMode.ps1\"\n# The Task Action command argument\n$TaskArg = '-ExecutionPolicy Bypass \"c:\\powershell\\GroupMaintenanceMode.ps1\" -ManagementServer \"' + $ManagementServer + '\" -GroupName \"''' + $GroupName + '''\" -DurationTimeMin ' + $DurationTimeMin + ' -Reason \"PlannedOther\" -Comment \"''' + $Comment + '''\"'<\/pre>\n<p>At this step my task is now created, but it still needs a schedule time. You can find all the information about how to schedule a task in MSDN <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa383915%28v=vs.85%29.aspx\">here<\/a>. In my context, I will use create(5) to trigger the task every fourth Thursday of each month:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">$triggers = $TaskDefinition.Triggers\n$trigger = $triggers.Create(5)\n$trigger.DaysOfWeek = '16'\n$trigger.MonthsOfYear = '4095' #all month: j:1 f:2 m:4 a:8 m:16 j:32 j:64...\n$trigger.WeeksOfMonth = '8'\n$trigger.StartBoundary = $TaskStartTime.ToString(\"yyyy-MM-dd'T'HH:mm:ss\"<\/pre>\n<p class=\"brush: actionscript3; gutter: true; first-line: 1\">To trigger my task one time at a specific time of day, I should use:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">$trigger = $triggers.Create(1)\n$trigger.StartBoundary = $TaskStartTime.ToString(\"yyyy-MM-dd'T'HH:mm:ss\")<\/pre>\n<p class=\"brush: actionscript3; gutter: true; first-line: 1\">To trigger my task on a monthly schedule, every first day of the month, I can use:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">$trigger = $triggers.Create(1)\n$trigger.StartBoundary = $TaskStartTime.ToString(\"yyyy-MM-dd'T'HH:mm:ss\")\n\n<\/pre>\n<p>All scheduling time is possible and have to be tried.<br \/>\nI create the action part of my schedule task, assign my command and the argument for my command:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">$Action = $TaskDefinition.Actions.Create(0)\n$action.Path = \"$TaskCommand\"\n$action.Arguments = \"$TaskArg\"<\/pre>\n<p>It&#8217;s time to create my task. There are multiple possibilities to create the task, you can have a look <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa381365(v=vs.85).aspx\">here <\/a>for more details.<br \/>\nI will create or update my task depending on whether or not it already exists. For information, I use the domain administrator\u00a0credentials for the execution.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\"># 6: create or update the task if it exists\n$rootFolder.RegisterTaskDefinition(\"$TaskName\",$TaskDefinition,6,\"ADSTS\\Administrator\",\"*********\",1)\n\n<\/pre>\n<p>I open a PowerShell windows to execute my script with the following command:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">.\\ScheduleTask.ps1 -TaskName \"Schedule Maintenance 1\" -TaskDescr \"Task schedule with PowerShell\" \u2013ManagementServer 'SCOM2012R2.adsts.local' -GroupName \"SQL Server Production Instances\" -DurationTimeMin \"5\" -Comment \"Maintenance for Patching\"<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9069\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask1.jpg\" alt=\"ScheduleTask1\" width=\"300\" height=\"23\" \/><\/a><br \/>\nMy schedule task has been created with the action and trigger I mentioned earlier:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9070\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask2.jpg\" alt=\"ScheduleTask2\" width=\"300\" height=\"46\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9071\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask3.jpg\" alt=\"ScheduleTask3\" width=\"300\" height=\"227\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9067\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4.jpg\" alt=\"ScheduleTask4\" width=\"300\" height=\"252\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9068\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask5.jpg\" alt=\"ScheduleTask5\" width=\"300\" height=\"300\" \/><\/a><\/p>\n<p>I\u00a0 hope this blog post will help you managing your maintenance periods for SCOM groups.<br \/>\nHappy scripting \ud83d\ude09<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last blog post, here, I spoke about how to place SCOM group in maintenance mode. This script is really interesting with an integration in Windows Task Scheduler. At the end, the main purpose is to plan a maintenance window of our different servers. Let&#8217;s see how we can do that with PowerShell script.&hellip;&nbsp;<\/p>\n","protected":false},"author":21,"featured_media":8184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133,42],"tags":[848,272,211],"class_list":["post-8178","post","type-post","status-publish","format-standard","has-post-thumbnail","category-database","category-operating-systems","tag-maintenance-mode","tag-powershell","tag-scom"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SCOM: schedule group maintenance task with PowerShell - dbi services Blog<\/title>\n<meta name=\"description\" content=\"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SCOM: schedule group maintenance task with PowerShell\" \/>\n<meta property=\"og:description\" content=\"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-08T10:29:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"798\" \/>\n\t<meta property=\"og:image:height\" content=\"671\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Savorgnano\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Savorgnano\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/\"},\"author\":{\"name\":\"St\u00e9phane Savorgnano\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\"},\"headline\":\"SCOM: schedule group maintenance task with PowerShell\",\"datePublished\":\"2016-06-08T10:29:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/\"},\"wordCount\":558,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/ScheduleTask4-1.jpg\",\"keywords\":[\"Maintenance mode\",\"PowerShell\",\"SCOM\"],\"articleSection\":[\"Database\",\"Operating System\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/\",\"name\":\"SCOM: schedule group maintenance task with PowerShell - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/ScheduleTask4-1.jpg\",\"datePublished\":\"2016-06-08T10:29:59+00:00\",\"description\":\"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/ScheduleTask4-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/ScheduleTask4-1.jpg\",\"width\":798,\"height\":671},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/scom-schedule-group-maintenance-task-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SCOM: schedule group maintenance task with PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\",\"name\":\"St\u00e9phane Savorgnano\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"caption\":\"St\u00e9phane Savorgnano\"},\"description\":\"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-savorgnano\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SCOM: schedule group maintenance task with PowerShell - dbi services Blog","description":"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"SCOM: schedule group maintenance task with PowerShell","og_description":"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode","og_url":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2016-06-08T10:29:59+00:00","og_image":[{"width":798,"height":671,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg","type":"image\/jpeg"}],"author":"St\u00e9phane Savorgnano","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"St\u00e9phane Savorgnano","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/"},"author":{"name":"St\u00e9phane Savorgnano","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7"},"headline":"SCOM: schedule group maintenance task with PowerShell","datePublished":"2016-06-08T10:29:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/"},"wordCount":558,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg","keywords":["Maintenance mode","PowerShell","SCOM"],"articleSection":["Database","Operating System"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/","url":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/","name":"SCOM: schedule group maintenance task with PowerShell - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg","datePublished":"2016-06-08T10:29:59+00:00","description":"Create schedule maintenance task with PowerShell to place SCOM group in maintenance mode","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/ScheduleTask4-1.jpg","width":798,"height":671},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/scom-schedule-group-maintenance-task-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SCOM: schedule group maintenance task with PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7","name":"St\u00e9phane Savorgnano","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","caption":"St\u00e9phane Savorgnano"},"description":"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-savorgnano\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=8178"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8178\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/8184"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=8178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=8178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=8178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}