Поделиться через


Using the agent scripting objects on a SCOM 2012 agent

<!--[if lt IE 9]>

<![endif]-->

Comments

  • Anonymous
    January 01, 2003
    The comment has been removed
  • Anonymous
    January 30, 2014
    Thanks for the mention Kevin! There is also a new way! http://www.systemcentercentral.com/powershell-desired-state-configuration-dsc-resources-for-system-center-revisited/
  • Anonymous
    February 02, 2014
    I have scorch doing it for us, runs a task to add or remove a management group then runs the flush health service task which effectively reloads the configuration
  • Anonymous
    February 02, 2014
    Nice one, Thanks Kevin! Also, I managed to use DCM from ConfigMgr 2012 to enforce the correct management group is configured on OpsMgr 2012 agents: http://blog.tyang.org/2013/11/30/deploying-opsmgr-202-r2-agents-using-configmgr-part-2/
  • Anonymous
    February 24, 2014
    We didn't read the note about the Local Administaror Rights...and just wondered why the folks above are not stepped into this error.
    We found this workaround: Run schtasks.exe in a Wsshell.run to create a Scheduled Job executing the net stop , start commands. Some confirmation prompts of schtasks.exe was fulfilled with "schtasks.exe .... < Yesfile.txt". Of course Yesfile.txt was created in same script using Textfile.Write("Y"), TextFile.writeln() will not work. This jobmanagement was quite tricky, but now works.
    Thanks again to Kevin. We will use the script in our migration project.
  • Anonymous
    April 03, 2014
    Hi Kevin, thanks for this...
    I have a question, it seems the mp does not seem to discover agenst on windows xp? Do I need to different discovery method?
  • Anonymous
    April 03, 2014
    Found out... replacing the Target of the discovery "Windows!Microsoft.Windows.Server.OperatingSystem" with "Windows!Microsoft.Windows.OperatingSystem" did the trick.
  • Anonymous
    June 17, 2014
    Having variable results with getting the Health Service to restart with a task. I'm running the Task with an account that is a member of an AD group which is, in turn, a member of the Administrators group on all our servers. Still however, I run into cases where after running task, the healthservice will stop but not start. Any idea why this might be?

    Thanks
  • Anonymous
    June 18, 2014
    Thanks Kevin! That sounds about right (althought it DOES work on a number of servers, but not on others, which I find a bit wierd). Will check into the Out of Band restart you have in your script. I wonder why we restart the Health Service? Doesn't Call objMSConfig.ReloadConfiguration make the changes effective anyway?
  • Anonymous
    June 24, 2014
    This monitor is working really well in identifying agents with old management groups. However, I have found that it's not picking up R2 servers. Any reason this might be?
  • Anonymous
    December 12, 2014
    I deployed `add management group to existing agent' vb script using SCCM 2007 but didn't work however works fine when I ran it . Any idea how to overcome this issue?
  • Anonymous
    February 04, 2015
    The MP/script works like a champ. BUT (and this is a HUGE one...) it's case sensitive on the removal of an MG. For example if you have myoldmg in the registry and the script is attempting to delete MYOLDMG, it won't work. The monitor works just fine, oddly enough.
  • Anonymous
    September 20, 2016
    SCOM 2012R2- Afternoon, Is there a powershell script or some other tool you could reference that would make "multihoming many agents" not such a time consuming task? My environment has approx 450+ servers (and growing), around half currently have agents on them, but not all are multihomed. My goal is to get agents on all the servers and have them multihomed, We have three tiers (Test/Dev( 1 mgmt svr), QC(2 mgmt srvs) and Production(2 mgmt srvs). I want to end up with all the agents reporting up to Production but have them also homed to thier respective tiers? Is this possible? For currently installed and future ones? I am told that doing so will make creating dashboards and views for mon itoring much more successful/easier...?Thanks as always for you time and brain power!Tony
  • Anonymous
    October 20, 2016
    The comment has been removed
    • Anonymous
      October 20, 2016
      It is totally possible.Not easy to write in the console - so I'd start by writing a task.A task uses the same datasource - which is System.CommandExecuterProbeHere is an example: https://gallery.technet.microsoft.com/SQL-Server-RunAs-Addendum-0c183c32 OR - write a simple timed script rule - and have a simple vbscript call your command. That you can do easily in the console.
  • Anonymous
    January 08, 2018
    In the above "ManagementServiceConfigurationClass.AddManagementGroupThis method adds a new, but inactive, management group to the agent. " What if, I want this new MG active on the agent? Does a flush/restart need to happen?