Quantcast
Viewing all articles
Browse latest Browse all 11941

SCOM 2012 Maintenance Mode PowerShell Script Problems

I've seen other questions about this topic before, but none of them seem to address my specific problem, so I am starting a new thread.

I am writing a script to put a single server (not a group) into maintenance mode.   Here is the command that it ultimately tries to call:

 Start-SCOMMaintenanceMode-Instance$Instance-EndTime$EndTime-Reason$Reason-Comment$Comment     

So an exmaple would look like this:

Start-SCOMMaintenanceMode -Instance "$Instance -EndTime "02/03/2014 15:26:00" -Reason "PlannedOther" -Comment "Testing Maintenance Mode"

When my script tries to run this command, this is the error message that I get:

Start-SCOMMaintenanceMode : Start time must be before end time for maintenance mode.

Parameter name: startTime

At C:\users\x036036\Desktop\Start-SCOMMaintenanceModeForServer.ps1:143 char:21

+                     Start-SCOMMaintenanceMode -Instance $Instance -EndTime $EndT ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (Microsoft.Syste...anceModeCommand:StartSCMaintenanceModeCommand) [Start-SCOMMaintenance

   Mode], ArgumentOutOfRangeException

    + FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.OperationsManagerV10.Commands.StartSCMaintenanceModeCommand

I've tried to look at Start-SCOMMaintenanceMode help online, but I don't see that "startTime" is a parameter.  So what is this error message talking about?  What am I missing?  


Viewing all articles
Browse latest Browse all 11941

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>