Hi All,
I am trying to place multiple servers in Maintenance Mode in SCOM 2012 but i could not find any PoSh script or any other solution to do it.
Could someone help me please?
Regards, Srini
Technology Tips and News
Hi All,
I am trying to place multiple servers in Maintenance Mode in SCOM 2012 but i could not find any PoSh script or any other solution to do it.
Could someone help me please?
Regards, Srini
Hi,
Please find the script.
need to have access and you can provide list of servers in text file.
param([int32]$TimeMin, [string]$Reason, [string]$Comment)Regards
This could be done from SCOM console. from under Monitoring --> windows computer.
Right click , maintenance mode and start Maintenance mode.
Hi,
Please refer to the link below:
OpsMgr 2012: Group Maintenance Mode via PowerShell
Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
Hi Sridhar,
It does not work.
I opened a PS session and connected to the management group using
New-SCOMManagementgroupconnection -computername abc.com
and tried to run the script but it failed with errors.
new-object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed
due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\PS Scripts\MM.ps1:2 char:25
+ $api = new-object -comObject 'MOM.ScriptAPI'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
New-SCOMManagementGroupConnection : The Data Access service is either not running or not yet initialized. Check the
event log for more information.
At C:\PS Scripts\MM.ps1:4 char:18
+ New-SCOMManagementGroupConnection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Syste...nnectionCommand:NewSCManagementGroupConnectionComma
nd) [New-SCManagementGroupConnection], ServiceNotRunningException
+ FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.Core.Commands.NewSCManagementGroupConnectionCommand
Any Suggestion??
Thanks.
Hi Agarwal,
I need to place hundreds of servers in MM so doing it from console is not the easiest option.
Thanks
Hi,
Thanks for sharing the link. I hope it addresses my requirement.
Will go through it.
Thanks Xin.
It addressed my requirements just perfect.
I have added few cluster servers in that group as well so I believe it would also be put in to maintenance mode and don't throw any alerts, right?