Create override for monitors via powershell

I'll cut to the chase, i've already got a powershell script for OVERRIDING rules, but I now need one to do the same for Monitors. I also want to be clear that I do not wish to disable them. My reason for doing this is to stop monitoring for SQL, thus allowing
me to decide what I'd like to monitor and turn things back on one at a time.
I've already searched this forum and found numerous topics, all pretty much saying that's not possible. But these were topics from a few years ago, so I'm just seeing if anyone else has come across a way to do this more recently.
I'm using SCOM 2012 R2, running Powershell v3. 
Dave.

So the script I'm running is:
$Product = 'Microsoft.SQLServer.2012'
$list = Get-SCOMRule | Where-Object {$_.ManagementPackName -like "$($Product)*"}
foreach ($rule in $list) {
C:\scripts\CreateOverride.ps1 –ManagementServer ‘ManagementServer’ –ManagementPackID "($Product)_Overrides" –WorkflowID $rule.name –PropertyName ‘Enabled’ –PropertyValue ‘False’ –Enforced ‘True’ –ContextID ‘Microsoft.Windows.Server.Computer’
Not the easiest thing to read, but the CreateOverride.ps1 is in the fact the script from the blog. This works perfectly for Rules. It will run through, identify every Rule for SQLServer 2012 and override them to FALSE.
My problem is, I'm having an issue doing this for Monitors. Mainly because 'ManagementPackName' isn't a valid property for a Monitor.

Similar Messages

  • Creating enhanced detection method via powershell

    Hi folks,
    im trying to automate the application creation process and so far I got a lot of usefull hints and tipps from technet forum etc.pp.
    I would like to set an registry detection method via powershell.
    Since I am not used to C# I found a nice approach translating a C# script into PS script.
    http://social.technet.microsoft.com/Forums/de-DE/93bddee4-6aee-4641-b104-170968ad1549/automating-application-creation?prof=required
    Unfortunately I can't get it to work... (same error as descriped in the link above "generic Error from the Put()-Function.") When I am using e.g. an MSI productcode as detection method in my script, I am able to create an application with
    deploymenttype and detectionmethod.
    Has anyone a solution for this problem ? Or was anyone able to set a registry detection via powershell ? Is it possible ?
    Any help will be appreciated.

    Any time I've seen a Put() error, the problem has been I've been missing a needed property.
    If you are using Config Manager 2012 R2 (Not sure about previous versions), you can use the built in cmdlet Add-CMDeploymentType.  This is the command I use.  For a PS detection type, change ScriptType to Powershell and $Script will be your detection
    script.
    $param = @{ApplicationName=$Name
                    DeploymentTypeName=$ScriptName
                    InstallationProgram=$Install
                    ScriptType="VBScript"
                    ScriptContent=$Script
                    InstallationBehaviorType="InstallForSystem"
                    ContentLocation=$SourceLocation
                    UninstallProgram = $Uninstall
                    LogonRequirementType="WhetherOrNotUserLoggedOn"
                    InstallationProgramVisibility="Hidden"
            Add-CMDeploymentType @param -ScriptInstaller -ManualSpecifyDeploymentType -DetectDeploymentTypeByCustomScript

  • Create New Azure Subscription via PowerShell Enterprise Portal

    Hi all,
    I've got a scenario where we are working with a customer who has access to Windows Azure. They are looking to programmatically create new Windows Azure subscriptions for teams from Orchestrator runbooks.
    I know that you can use the Windows Azure PowerShell Cmdlets to do almost anything imaginable with Windows Azure Portal but there doesn't seem to be anything for PowerShell or automation for the Enterprise Portal where I would go to create these
    new subscriptions.
    Is there anything out there for the Enterprise Portal that I've missed?
    Richard Green | MCSA 2012, MCSE 2003, MCTS Desktop Virtualization, VCP5-DV http://richardjgreen.net

    Currently there's no API or PowerShell cmdlet that allow us to create subscriptions programmatically. Please understand you can't simply create a subscription whenever you want. You need to bypass some verifications, such as credit card. You should also
    be careful when creating subscriptions, as that might affect your billing method. Each subscription will result in a separate bill (although they can use the same credit card, as the case of enterprise agreement). In most cases, you can't let a user to use
    PowerShell to create a subscription as he wants. Instead, there should be an approval process. However, you can try to submit a feature suggestion at: http://feedback.windowsazure.com/forums/34192--general-feedback  

  • Set Certificate for User via Powershell?

    I would like to work with certificates in Office365 similar to "set-aduser abc -Certificates...". I couldn't find a way to connect to Azure AD, and in MSOnline there is no Certificates parameter for set-msoluser.
    Any idea?

    Hi Sir,
    Base on my experience, before your call the set-msoluser, you need connect to Azure AD using certificate, please see this code:
    1.using the below code to connect to Azure AD
    $msolcred = get-credential
    connect-msolservice -credential $msolcred
    2.using the set-msoluser
    Set-MsolUser -UserPrincipalName [email protected] -UsageLocation "CA"
    Please see those references:
    http://technet.microsoft.com/en-us/library/jj151815.aspx
    http://msdn.microsoft.com/en-us/library/azure/dn194136.aspx
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Bulk Override to enable "Generate Alert" parameter for monitors/rules

    Hi Experts,
    I am working on fine tuning Exchange 2010 management pack as per the monitoring requirement of the team. Most of the monitors have their workflow enabled but have the Generate Alert parameter disabled.
    I was using Override Creator by Borris for enabling and disabling the workflows, but it doesnt help in creating override for Generate Alert parameter.
    I almost have 700+ monitors or rule to be enabled for generating alerts is there any way i can do this using any script or any other tool?
    Regards,
    Prajul Nambiar

    Hi 
    GenerateAlert is the property of override same
    as enable, you can apply override using below script and enable all monitors to generate alert.
    Import-module operationsmanager
    New-SCOMManagementGroupConnection
    $mps=Get-SCOMManagementPack |?{$_.name -match "sql"}
    $overrideMp= Get-SCOMManagementPack -Displayname "sql.Override"
    $Monitors=$mps|Get-SCOMMonitor |?{$_.xmltag -eq "UnitMonitor"}
    foreach($Monitor in $Monitors)
    if($Monitor.AlertSettings.AlertOnState -eq $null)
    $Target= Get-SCOMClass -id $Monitors[0].Target.id
    $overridname=$Monitor.name+".Override"
    $override = New-Object Microsoft.EnterpriseManagement.Configuration.ManagementPackMonitorPropertyOverride($overrideMp,$overridname)
    $override.Monitor = $Monitor
    $Override.Property = ‘GenerateAlert’
    $override.Value = ‘true’
    $override.Context = $Target
    $override.DisplayName = $overridname
    $overrideMp.Verify()
    $overrideMp.AcceptChanges() 
    Note : you need to have override mp with name sql.Override
    Regards
    sridhar v

  • Not able to create entries for ALBTCMON (SCM 4.10)

    I am trying to create entries for monitoring jobs that start with "SAP_*" and I am trying to add entry into ALBTCMON table.  But system is trowing the message as below.
    ===============================================================
    Create data processing function module
    Message no. SV023
    Diagnosis
    You have called the function for editing view contents. The function modules needed for the maintenance functionality of this view are not available in the system.
    Procedure
    The data processing function module must be re-generated.
    Contact the system administration.
    ===============================================================
    Can somebody tell whats wrong.  I am working in SCM 4.10.
    Regards,
    Giridhara

    Make sure the xWebsites metadata field has the siteId of your site. And as Srinath said, make sure it's "Released"; which can take a moment or two.

  • Create subscription for overrided monitor

    Hello guys. Have an issue:
    I've created a new monitor for all Servers(Windows Server Operation System Target), set it to disabled. Then I override it to specific group with other thresholds. Alerts are going well, but e-mail do not go. Trying to create subscription from scratch, select
    my monitor (which is disabled) - still mail doesn't come. Questions are:
    1. If I make a subscription from alert, will this subscription apply to all server's group, to which I overrided monitor, or only server from which I created alert?
    2. Can I make a subscription from scratch to this alerts (need to change description, but cannot go to next line if creating from alert)
    3. How can I make a e-mail separation, depending on server group? I.e. I want alerts, generated by overrided monitor specifically for BizTalk servers group to send to BizTalk admins e-mail etc. As I understand, I need to add to subscription criteria "raised
    by any instance of specific group"?

    Hi,
    1) As your Monitor is disabled for all Servers by default and you only enabled for the Servers where you need it the subscription will apply to all Servers where Monitor is enabled.
    2) Yes you can create the subscription from scratch
    3) You have to create a Subscriper for each group and configure it in the subscription. If the same Monitor is running for different Server groups with different responsible departments you have to create a subscription for each department and configure
    the "raised by any instance in a specific group" Condition.
    Cheers
    Christoph Maresch | My blogs: blog.cmaresch.at | XING:
    Christoph Maresch
    | Linkedin:
    Christoph Maresch

  • Server 2012 R2: How do I set VLAN data for the Host Virtual Switch (via PowerShell)?

    I need to modify the Host (NOT the VM's) VMSwitch VLAN settings via Powershell for automation purposes.
    In Server 2012 (NOT R2), this can be done via modifying
    MSVM_VLANEndPointSettingData
    However, it seems in Server 2012 R2, that class is gone. I've manually searched through the MSVM classes, and it seems that the Host VMSWitch VLAN settings are stored
    in MSVM_EthernetSwitchPortVlanSettingData. Unfortunately, I have no way of tying that class to a specific VMSwitch.
    Any know how to do this on Server 2012 R2?

    Hi,
    I found some similar issue with your case, however this forum is not focus on the develop related issue,
    Therefore I suggest you more about the develop question please post to the MSDN forum.
    The related information:
    Problem with CPU load and WMI errors when Hyper-V is installed?
    http://social.technet.microsoft.com/Forums/windows/en-US/4eca1f42-8630-48b4-85fa-e9569445d832/problem-with-cpu-load-and-wmi-errors-when-hyperv-is-installed
    The third party solution:
    How to: Fix error 0x80041010 on Windows 8.1 + Hyper-V
    http://www.seankilleen.com/2013/11/how-to-fix-error-0x80041010-on-windows.html
    MSDN forum Developer Network
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=WAVirtualMachinesVirtualNetwork&filter=alltypes&sort=lastpostdesc
    Thanks for your understanding and support.
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • RZ20: how to create status attribute for monitoring object ?

    Hello,
    I am brand new into RZ20 maintenance and my question may be silly.
    Anyway, SAP supplies monitoring objects customized with performance attribute (such as MTE class SAPconnect Error). Instead of having such performance attribute, I would prefer to have a MTE class with status attribute in order to trigger an alert each time a there is a SAPconnect message with error.
    Is it possible to define such status attribute ? If so, how could it be achieved ?
    Thank you for your help.
    Regards,
    Fabrice

    Hello Fabrice,
    the monitoring object and its attributes are defined by the data collector. This means the attributes are hard coded (in the function module or report in case of data collection method (a passive data collector) of directly in the kernel (an active data collector).
    And as long as the data collector is delivered by SAP, changing the coding is not a good idea
    So only way would be to create your own monitoring objects using your own data collector. A documentation how to do this is available in the Service MarketPlace: "<a href="http://service.sap.com/~sapidb/011000358700001752571999E/SUPPLIER_46A_EN_Neu.pdf">How to Write a Data Supplier for the Alert Monitor</a>".
    Regards, Michael

  • What is the Action account type to be created to Workgroup agents in SCOM for monitoring them

    Hi All,
    I have newly deployed 20 Workgroup Windows server 2008 R2 DMZ machines in our SCOM 2007 R2. We have deployed it using certificates and ever thing is working fine except for the below.
    I keep getting the below alert saying "Run as account login check failed" on all the 20 agents.
    So i want to know what type of Run as account is to be created for monitoring the Workgroup agents from the below list ?
    Also to which all Run as profile do i need to add the account post creating the Run as account so i the agent is fully being monitored ?
    Gautam.75801

    Hey
    Gautam.75801, I use Action Account. As mentioned also make sure your distribute the Action account to the workgroup computers and update the default action account as Roger mentioned.
    Cheers,
    Martin
    Blog:
    http://sustaslog.wordpress.com 
    LinkedIn:
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Is update not approved for a specific group via powershell.

    My apologies in advance for asking a similar question to the one I asked two months ago,
    is update approved for specific group via powershell? I thought I had this covered, but as I've found time to continue to work on this project I see that it does not.
    I have a script that iterates through updates and if the release date is older than 30 days and they have not already been “Approved for Install” or “Approved for Removal” for a specific group it approves them. I am currently faced with the dilemma that
    when an update is set to “Not Approved” for the specific group I’m working on it does not come across in my group’s approvals and there for I cannot detect its current state to know if I should approve it. In other words, I don’t want to approve an update
    that I set to not approved for a specific group.
    I am currently achieving all this so far by connecting to my WSUS server and getting any and all updates via $all = $wsus.GetUpdates(). I Then get my group’s approved updates via $groupApproved = $wsus.GetUpdateApprovals($GroupScope) where ApprovedStates
    = "Any" and ApprovedComputerTargetGroups.Add($current_wsus_group). While iterating through $all I grab updates that are older than 30 days and check to see if the updateID exists in my $groupApproved. If it does not, I approve the update. Like I
    said before, an explicitly unapproved update for my group does not show up in my $groupApproved. I understand it’s because of my GetUpdateApprovals($GroupScope) being just that and only getting approved for install or uninstall, but even when I try to simply
    GetUpdates($GroupScope) I am still not returned explicitly unapproved updates. Below is a screen shot of what I mean by explicitly setting an update to unapproved for a group. I’ve read up on
    ApprovedStates and possible enumerated values and it does include "NotApproved" defined as "Includes updates that have not been approved or declined.".
    Hope all that makes sense, thanks for the help.

    So, I've decided to go about this a different way. Rather than getting all updates and comparing them to approvals via a scope of updates for my specific group (which includes all actions but Not Approved), I am going to look at specific approvals for each
    update and see if there is a match for my group. A simplfied version of this is below. 
    $AnyAllUpdates = $wsus.GetUpdates()
    foreach ($udpate in $AnyAllUpdates)
    if ($update IsNOTDeclined IsNOTSuperseded LegacyNameNOTIA64 CreationDateLTDATE yada yada yada)
    # get the approvals for this udpate as they relate to my group
    $uApprovals = $update.GetUpdateApprovals() | ?{$_.ComputerTargetGroupId -eq $wsus_group.Id}
    if ($uApprovals)
    if ($uApprovals.action -eq "Install")
    # do nothing, the udpate was approved for install
    elseif ($uApprovals.action -eq "Uninstall")
    # do nothing, the update was approved for uninstall
    elseif ($uApprovals.action -eq "NotApproved")
    # do nothing, the udpate was not approved for install
    else
    # since there was no specific action then it must be an inherited not approved from teh parent group
    # approve the update!

  • Create MP via Powershell in SCOM 2012 SP1

    Is it possible to create MP via Powershell in SCOM 2012 SP1? If so, how?
    (New-SCOMManagementPack is unrecognized cmdlet) 

    $name="NewMP"
    $displayname="NewMP"
    $mpStore = New-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackFileStore
    $mp = New-Object Microsoft.EnterpriseManagement.Configuration.ManagementPack($name, $displayName, (New-Object Version(1, 0, 0,0)), $mpStore)
    import-scommanagementpack $mp

  • Powershell creates shortcut for every exe in folder

    So i have a script to create a shortcut onto the desktop but i just found out that i need it to create shortcuts for multiple .exe's in a folder and for the life of me i can't figure out how to do this. below is what i have .Powershell$TargetFile = "c:\shared\*.exe"$ShortcutFile = "$env:homedrive\Desktop\test\*.lnk"$WScriptShell = New-Object -ComObject WScript.Shell$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)$Shortcut.TargetPath = $TargetFile$Shortcut.Save()Powershell$TargetFile = "c:\shared\*.exe"$ShortcutFile = "$env:homedrive\Desktop\test\*.lnk"$WScriptShell = New-Object -ComObject WScript.Shell$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)$Shortcut.TargetPath = $TargetFile$Shortcut.Save()

    1. what is a transient variable?A transient variable is a variable that whose value is not going to be serialized2. What is synchronization?With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources.Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object’s value. This often leads to significant errors.3. What’s new with the stop(), suspend() and resume() methods in JDK 1.2?The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.4. Is null a keyword?"null" is not a keyword. .null is a literal.5. What state does a thread enter when it terminates its processing?When a thread terminates its processing, it enters the dead state.....Read More
    Read More

  • Looking for a way to install Windows Intune via powershell

    I'm very new to Powershell and completely lost on how to do this.
    Looking for a way to install Windows Intune via powershell from a self extracting zip file I will send to remote users. This will also need to run Corp admin level privileges to install.
    Thank you in advance for your help.

    Hi Mtirado,
    For Windows Intune issue, I recommemd you can post in dedicated forum for more effective support:
    https://social.technet.microsoft.com/Forums/en-US/home?category=windowsintune
    If you get the initial Powershell script, and the script encounter error or problem, you can post back with current script and issue.
    Thanks for your understanding.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Unable to create data source for planning via workspace

    I have installed the following products in Hyperion 11.1.2
    - Foundation
    - Essbase, EAS
    - Planning
    - Reporting & Analysis
    However, when I log in to Workspace (http://server:19000/workspace, I only see the following menu options under Navigate -> Administer
    -Shared Services Console
    -Workspace Server Settings
    -Manage preferences
    There is another menu item Navigate->Open Items which is grayed out.
    I am able to create the Planning application via http://server:8300/HyperionPlanning/AppWizard.jsp url but unable to do that via workspace.
    Any help regarding why I do not see the other menu options under Navigate->Administer would be highly appreciated.
    Edited by: user12209997 on Dec 14, 2010 1:30 AM

    Try running the configurator again and go through "Foundation > Configure web server", I would then restart the services in the correct order and see if that helps.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • How do I complain about my broadband service?

    Hi there I'm not sure if this is the right area to be posting; but I hope that someone will be able to help me, as the BT automated system gives you no option to complain, and when you ask to be put through to the complaints department, you get put t

  • ISight Built-in not working more info

    Also the system props say vender specific they sgould be saying builtin isight. how to i add/install drivers, and where are they? <post edited by Host>

  • Alert: Invalid constant pool entry

    Hi, When I install midlet application in mobile phone I got this error "Alert: Invalid constant pool entry" and says "Application Error". When I create a object of a class at that time this error occurred. In that class I have used a constant which v

  • Mac OS Lion CS 5.5 "Pre-Chrome" Install Problem / Solution!

    After hours and days of frustration surrounding what should have been a very simple update from CS5 to CS5.5 on Mac OSX Lion (the latest version), I finally found a solution that makes perfect sense, and acutally works. Here's my brief rant: Adobe -

  • "Object Browser" Table Query "Drill Up" Fails with ORA-00942

    I feel I have tested this capability in an earlier release of apex and it worked flawlessly... :) but currently it is not. :( It seems to be a problem with [ APP_ID=4500 Page=46 ]. To Duplicate the error... Note: This example assumes "Sample Applicat