Home
%3CLINGO-SUB%20id%3D%22lingo-sub-321989%22%20slang%3D%22en-US%22%3EMaintenance%20Mode%20by%20Config%20File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-321989%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Dec%2009%2C%202008%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EDerek%20Harkin%20did%20some%20good%20work%20with%20his%20management%20pack%20that%20allows%20agents%20to%20be%20placed%20in%20maintenance%20mode%20from%20the%20agent%20itself%20simply%20by%20executing%20a%20script%20-%20no%20requirement%20for%20powershell%2C%20.net%2C%20etc%20and%20the%20user%20who%20executes%20the%20script%20does%20not%20need%20any%20rights%20to%20OpsMgr!%20The%20script%20would%20generate%20an%20event%20which%20the%20management%20pick%20reads%20and%20responds%20to%20by%20executing%20a%20powershell%20script%20on%20the%20management%20server%20that%20actually%20does%20the%20work%20of%20putting%20the%20agent%20in%20maintenance%20mode.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20modified%20Derek's%20management%20pack%20to%20allow%20server%20owners%20to%20specify%20a%20config%20file%20on%20the%20agent%20and%20simply%20make%20additions%2Fchanges%20to%20the%20config%20file%20to%20configure%20when%20the%20agent%20should%20enter%20maintenance%20mode%20and%20how%20long%20maintenance%20mode%20should%20last.%26nbsp%3B%20This%20config%20file%20can%20either%20specify%20a%20recurring%20weekly%20schedule%20or%20a%20one%20time%20entry.%26nbsp%3B%20Take%20a%20look%20at%20the%20readme.txt%20for%20more%20information.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FMSDNBlogsFS%2Fprod.evol.blogs.msdn.com%2FCommunityServer.Components.PostAttachments%2F00%2F09%2F18%2F75%2F29%2FAgentMaintMode.zip%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20AgentMaintMode.zip%20%3C%2FA%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-321989%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Dec%2009%2C%202008%20Derek%20Harkin%20did%20some%20good%20work%20with%20his%20management%20pack%20that%20allows%20agents%20to%20be%20placed%20in%20maintenance%20mode%20from%20the%20agent%20itself%20simply%20by%20executing%20a%20script%20-%20no%20requirement%20for%20powershell%2C%20.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-321989%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eopsmgr%20maintenance%20mode%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on MSDN on Dec 09, 2008

Derek Harkin did some good work with his management pack that allows agents to be placed in maintenance mode from the agent itself simply by executing a script - no requirement for powershell, .net, etc and the user who executes the script does not need any rights to OpsMgr! The script would generate an event which the management pick reads and responds to by executing a powershell script on the management server that actually does the work of putting the agent in maintenance mode.


I modified Derek's management pack to allow server owners to specify a config file on the agent and simply make additions/changes to the config file to configure when the agent should enter maintenance mode and how long maintenance mode should last.  This config file can either specify a recurring weekly schedule or a one time entry.  Take a look at the readme.txt for more information.


AgentMaintMode.zip