After creating a Powershell script monitor - how to import in Operation Manager 2012 ?

Hello!
I just completed all the steps in this article:
http://social.technet.microsoft.com/wiki/contents/articles/16752.management-pack-composition-exercise-2-creating-a-monitor-based-on-a-windows-powershell-script.aspx?CommentPosted=true#commentmessage 
So now I guess that the just created Management Pack should be imported in Operation Manager 2012, and then also folders and views should be created in order to have it showing green/red based on the values returned by the script.
In the article there's no pointer to that procedure, so can you please provide a good link where the steps are explained?
thanks!

Have a look at the following video, it steps through how to create rules and monitors using PowerShell scripts
https://technet.microsoft.com/en-us/video/how-do-i-create-a-rule-and-monitor-using-a-windows-powershell-script-in-a-system-center-operations-manager-management-pack.aspx
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.

Similar Messages

  • Powershell script monitor with encrypted password

    I have created a powershell script based monitor in my management pack and everything is ok but I can't get my credentials work inside the script. I want to open pssession to another computer with my credentials. I have triple checked that my pssession is
    working because I can access it from powershell console.
    This works perfectly at local server from PSconsole:
    $EncryptedPassword ="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000534b2....etc...etc..."
    $pw = convertto-securestring -String $EncryptedPassword
    $cred = new-object System.Management.Automation.PSCredential -argumentlist "MyDOMAIN\MyACCOUNT",$pw
    $s = New-PSSession -ComputerName "MyServer" -Port MyPort -Credential $cred
    But when I run the same lines inside my management pack the convertto-securestring
    does nothing, it just wont convert the encrypted password to secure string!
    I have tried this plain text method and it works
    inside my management pack, but I don't want to use it because you can see the password in plain text:
    ConvertTo-SecureString -String "myPlainTextPassword" -AsPlainText -Force
    This is the $error variable, so it's basically says that I don't have anything in the password secure string variable because the convertion did not work for some reason:
    The argument is null. Provide a valid value for the argument, and then try running the command again. Cannot process argument transformation on parameter 'Credential'. PromptForCredential Exception calling ".ctor" with "2" argument(s):
    "Cannot process argument because the value of argument "password" is null. Change the value of argument "password" to a non-null value." The system cannot find the file specified. Exception calling "SecureStringToBSTR"
    with "1" argument(s): "Value cannot be null. Parameter name: s" The system cannot find the file specified. Exception calling "SecureStringToBSTR" with "1" argument(s): "Value cannot be null. Parameter name: s"
    The system cannot find the file specified. 
    So is there some known issue with SCOM Agent / management pack when you are dealing with convertto-securestring
    function with encrypted passwords?
    I used these methods to encrypt the password: Technet article about encryption

    I got it to work!
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="MyClass" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false" Extension="false"
    />
          </ClassTypes>
        </EntityTypes>
        <SecureReferences>
          <SecureReference ID="MyRunAsAccountProfile" Accessibility="Public" Context="System!System.Entity" />
        </SecureReferences>
    <ScriptBody>param (
      [string]$Username,
      [string]$Password
    $API = new-object -comObject "MOM.ScriptAPI" 
    $PropertyBag = $API.CreatePropertyBag()
    $cred = New-Object System.Management.Automation.PSCredential -Argumentlist @($Username,(ConvertTo-SecureString -String $Password -AsPlainText -Force))
    $s = New-PSSession -ComputerName "myserver" -Credential $cred
    Invoke-Command -Session $s -ScriptBlock { $service = Get-Service -Name Spooler}
    $invcom = Invoke-Command -Session $s -ScriptBlock { $service.status}
    Remove-PSSession -Id $s.Id
    if ($invcom.Value -ne "Running") {
    $PropertyBag.AddValue("State","ERROR") 
    $outputLongLine = "Spooler Service is not running on target server!" 
    $PropertyBag.AddValue("Description", $outputLongLine)
    else {
    $PropertyBag.AddValue("State","OK") 
    $outputLongLine = "Spooler is Running on target server."
    $PropertyBag.AddValue("Description", $outputLongLine) 
    $PropertyBag</ScriptBody>
    <Parameters>
    <Parameter>
    <Name>Username</Name>
     <Value>$RunAs[Name="MyRunAsAccountProfile"]/Domain$\$RunAs[Name="MyRunAsAccountProfile"]/UserName$</Value>
    </Parameter>
    <Parameter>
    <Name>Password</Name>
    <Value>$RunAs[Name="MyRunAsAccountProfile"]/Password$</Value>
    </Parameter>

  • When i try to install a program in my macbook Pro, the message appear: Run preflight scrip and after Run the postflight script. How i'll fix this?

    When i try to install a program in my macbook Pro, the message appear: Run preflight scrip and after Run the postflight script. How i'll fix this?

    Here are the Mac requirements:
    System Requirements Mac Version (*)
    Mac OS X 10.6.1, 10.7.1, 10.8.1 or 10.9.1
    1.83 GHz cpu or better
    Nvidia Geforce 8600, ATI Radeon X1600 or better (min 256 MB VRAM)
    1 GB RAM
    2 GB free hard drive space
    DVD-ROM Drive
    Are you sure that you have the Mac version, as there is a Windows version, as well as a few game console versions.
    Sounds as though that may be a Windows or other version.

  • Basic Network Monitoring for Cisco Operation Manager 2012

    Hello,
    Please bear with me as i'm new the Operations Manager 2012 world. I've just installed operations manager 2012 in our environment and i've setup a network management point. I've discovered my networking gear which is primarily cisco equipment. The devices
    are appearing as CERTIFIED. It appears that they are HEALTHY however in most cases i'm getting some arbitrary monitors. I have a 6509 switch where memory and processor appear to be being monitored out of the box. I'm receiving alerts and everything.
    My question is how do I turn on monitoring for other discovered components. I seem to understand I can make SNMP monitors under the authoring pane if i know the OID. That sounds like it'd be tedious work for such a simple and basic monitor. However I was
    under the impression I would be able to monitor a lot of these components with a simple click of a button. Is this not the case? I'm primarily interested in monitoring the state and performance of particular interfaces as well as the state of the power supplies
    in our switches. Is there a guide that explains the basic principles of this. What are my options?
    Thanks!
    -Brandon

    Hi,
    You will need to edit the discovery and broaden the range. You may use recursive discovery.
    Recursive discovery will try to discover any other network devices it knows about through its Address Routing Protocol (ARP) table, its IP address table, or the topology Management Information Block (MIB) to grow the network map and present all applicable
    devices to you for monitoring.
    You can also filter out devices that you don't want to be discovered by using properties such as the device type, name, and object identifier (OID). This is a handy option if you wanted to quickly discover all the network devices in your network except,
    a small number or some with a specific criteria.
    In really large networks with a lot of network devices, keep in mind that there is a default limit of 1500 network devices that can be discovered recursively. You can of course tweak this limit to suit your environment if you wish, but for most people, this
    won't be needed.
    More details, please go through the article below:
    http://kevingreeneitblog.blogspot.com/2012/07/scom-2012-network-monitoring-explicit.html
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Network Monitoring~~~Operations Manager 2012 R2

    Hi All,
    I am using SCOM 2012 R2 when i am trying to discovery network devices it discovered, but its showing in discovery rules but not in  network devices.
    Guys can you lent me how much time will it take ...

    Hi,
    Discovery of a large number of devices can take several hours to complete. We may need to wait for some time.
    In addition, please go through the below links for more helpful information related with network discovery:
    How to Discover Network Devices in Operations Manager
    http://technet.microsoft.com/en-us/library/hh278846.aspx
    Troubleshooting Network Discovery in SCOM 2012
    http://www.code4ward.net/main/Blog/tabid/70/EntryId/105/Troubleshooting-Network-Discovery-in-SCOM-2012.aspx
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Regards,
    Yan Li
    Regards, Yan Li

  • How to import old Session Manager data

    I just upgraded to Firefox 35.0 and had to reinstall Session Manager. Now Session Manager doesn't show any of the old saved sessions. I've found the file containing these old sessions, but can't figure out how to import that file so that I can use it with the new versions of Firefox and Session Manager.

    #Go to your profile folder:
    #*[https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile Find you profile]
    #Exit Firefox.
    #Look for sessions folder, enter in it and put here that file with old sessions.
    #Restart Firefox and try load the session.

  • After creating a new user account, how do I move my files into the new user?

    I have an issue where my 'Desktop/Screensaver' prefs seem to be corrupt somehow. When I click on that icon in System Preferences, it stalls and I get the spinning ball, thus resulting in a force quit. After reading a Mac Format magazine where someone wrote in with a similar issue, they said to trash various prefs (did that and made no difference) and if that didn't work, try creating a New User account (therefore creating brand new system prefs) and move your stuff over.
    Well, I've created the New User account, but I can't figure out how to move/copy my stuff into the user folders. After copying and attempting to move stuff in, I see folders with a red circle with a white line through it (like a 'no entry' sign).
    Any clue as to how this can be done? All I'm trying to do is to reinstate the system prefs so they are not corrupt anymore on my log-in.

    No. Not the main Library folder. Make absolutely sure you are in the Home Library folder and not the main Library folder.
    Your Home Library folder is hidden in Lion. To get to it, in the Finder menu, select GO and hold the option key down. Select Library in the submenu. The Finder window will open in your Home Library. This is where your user prefs are stored.
    Once there, you will see the Preferences folder. Open it up, select all items within it and move them to the trash. You will need to restart in order for the new Finder preferences to be recreated.
    Once you restart, then you will be back to the default preferences to the system and all applications. And yes, it will affect all settings including your Dock, just as logging into a new user. You will have to reset everything there also.
    If you wish to do a selective method, instead of deleting all preferences, try deleting the one associated with your problem. Screen saver problems should be affected by the system preferences, so try deleting this:
    com.apple.systempreferences.plist
    com.apple.systempreferences.plist.lockfile
    Note that when you delete system file preferences, a restart will be required. For applications, just quit the application before trashing preference files.

  • Vendor purchase data cahnge after create the po. Now how to reflect in po

    Hi,
    I have create a vendor as  Domestic vendor but this is IMPORT vendor.
    Po create as on 26.08.2010 .. (All legal documentation in complete)  but when PO is created Excise duty is not capturing  in PO
    Vendor change as import PO on 15.12.2010 .(Domestic to import )
    after change the vendor field how to effect come in PO..
    any body help me ..........

    Hi,
    Po is tractional data it will capture all information from Vendor Master,
    in your case PO captured old master data, for resolving your issue we have two ways,
    1 -  Cancel Old PO & Create same PO.
    2 - with help of ABAPer you can update table values.
    Regards,
    Viswa

  • Howto create a powershell script to search the C drive for any *.pst files and copy them to a single directory

    I have a bunch of people who are saving their pst files all over the place. how do I write a script that does the following
    searches the C:\ drive for *.pst and copies them all the E:\pstfiles

    Hi,
    How about using below command:
    Move-Item c:\*.pst E:\pstfiles -force
    For more details about move-item, I would like suggest you use get-help command:
    get-help move-item
    In addition:
    Using the Move-Item Cmdlet
    http://technet.microsoft.com/en-us/library/ee176910.aspx
    Regards,
    Yan Li
    Yan Li
    TechNet Community Support

  • Operations Manager 2012 R2 : how to find all my rules, monitors and alerts (all in one custom MP)

    How do I find all the rules, alerts, monitors and whatever in a give custom Management Pack?
    All the bits and pieces I have created I have stored in a MP called "1 - MYDOMAIN CUSTOM"
    Now suppose I want to review all my customisations. How do I do it? I had hoped that it would appear in a scope somewhere...
    CarolChi

    Many thanks
    1) I can't find this: in the Authoring Console I have
    management pack templates, distributed applications, groups, management pack objects
    In Management Pack Objects I have Attributes, Monitors, Rules, ... but no where can I find ALL the customisation I have done.
    2) Where can I find an example of powershell?
    3, 4) Where do I get the override explorer. I was hoping not to have to use other tools.
    5) I read that the Efffective Configuration Tool works with older versions of OpsMgr - is this true?
    6) Again can you help with a link to the MP Viewer Tool?
    CarolChi

  • Script QPAC: how to get a process manager instance?

    Hi,
    I was desperately fiddling about the scripting QPAC, trying to get an instance of process manager.
    Since PATAbstractServiceEx is an abstract class, I cannot instantiate it and call its getContext().getProcessManager() methods.
    I also tried to access a session using QLCSessionFactory.createSession("...") and then calling the session's getProcessManager() method. But no sessions were found.
    Does anyone know, which classes/methods to use in order to get a process manager instance?
    Regards,
    Steve

    import com.adobe.workflow.manager.ProcessManager;
    ProcessManager _pm = patServiceContext.getProcessManager();
    Page 36 of "Creating workflows".
    Howard
    http://www.avoka.com

  • Powershell script or command to Import AD USers with GUID

    I need to import few users with their GUID's from our Training domain to Production domain. Our requirement is Users need to login their existing pc's local profile, once they move to
    Production environment.
    Our setup;<o:p></o:p>
    Training domian:melbourne.com<o:p></o:p>
    Domin controller: Training<o:p></o:p>
    Production domain: melbourne.com<o:p></o:p>
    Domin controller:
    Production
    Note:
    I tried ADMT but it is not allowed to do for source and target as same domain name.
    It is really appreciate any one’s expertise on this scenario to import AD users and computers.

    You're not going to be able to force creation of an object with any specific guid.  That's not relevant to what you're trying to do any way.   You also won't be able to clone the SID, since a, it's not supported, and b, the sid contains the
    unique domain identifier which will be different for each domain even though the names are the same.
    You could use sidhistory to help fix the permissions (add the sid from the account in test to the sidhistory of the account in production).  But you'd need a trust relationship between the domains, and I'm not sure if that is supported when the domains
    have the same name. You might need to add a different UPN suffix and set accounts to migrate to have that suffix to get around that.  I've never actually looked into that situation.
    ADMT won't do it though.  You might have a command prompt utility that can do it in ADMT. But you should be able to do it with powershell by calling an api. You can probably use Ashley McGlone's sidhistory module for most of this.
    https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Module-for-08769c67
    You will want to review the details and requirements relating to modifying sidhistory:
    http://msdn.microsoft.com/en-us/library/ms677982(v=vs.85).aspx
    Okay looking closer, you'll need to do this from C++.  The easiest way is probably to use the sidcloner binaries (https://code.msdn.microsoft.com/windowsdesktop/SIDCloner-add-sIDHistory-831ae24b#content
    ) and call them on demand.
    Honestly the best thing is probably get a consultant to come spend a few hours to do it for you.  Messing with sidhistory can be a huge time sink.

  • Operations Manager 2012 - TCP Port Monitor

    Hi,
    Is it possible to have the TCP port monitor only alert if it fails on subsequent polls, instead of the single connection failure which is the default? We have 3 GPRS connections which intermittently
    fail, so we only need to be alerted if they don't come back online after a 5-10 minute inverval and 2 failed connection attempts in a row.  We have orchestrator so perhaps a runbook needs to be created?
    Thanks

    Hi,
    Yes. The Runbook could do this trick. I think you need to make the monitors not to generate alerts when health state changes. Then use runbook to monitor the Health State, if some conditions are ture, an alert will be generated.
    I am not so familiar with Orchestrator, you may ask at Orchestrator to get answered of how to design the Runbook.
    Juke Chou
    TechNet Community Support

  • SQL 2005 discoveries after upgrade to Operations Manager 2012 R2 UR3 upgrade

    Hi
    We did a (succesfull) upgrade of our SCOM 2012 SP1 environment to 2012 R2 UR3. We noticed after the upgrade that databases of some  SQL 2005 clustered instances on Windows 2003 R2 SP2 are no longer discovered. checking the eventlog shows the eventid
    21405 on the DiscoverSQL2005DB.vbs disvovery (process exited with 4294967295)
    Browsing and checking several webfinds didn't provide a solution yet. Perhaps I overlooked the obvious....
    Possible solutions which didn't bring relief yet:
    check on SQL SP's
    WMI registry settings [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\CIMOM] ": Low/High Threshold On Events
    WMI repair, mofcomp...
    Uninstall/Reinstall Monitorring Agent
    manual run of the discover script returns all info
    The runas discover and monitor account(s) are local admin on the OS and SA on the SQL instances
    I'm stuck: right now we wanted to present some distributed applications through LiveMaps in scom to our internal customers and some essential databases are no longer discovered/monitorred.
    Any help highly appreciated

    I'd just like to add that since upgrading all of our environments to 2012 R2 UR3, we are receiving multiple alerts for multiple script failures - e.g. Events 21404, 21405 to name a couple.
    I have logged a few Microsoft Premier Support Calls and they are still working on them.
    We get this on all SQL 2005,2008 running on Windows Server 2003.  Microsoft's response to this is:
    "This is a known bug in the latest SQL MP. This is due to the problem with the DiscoverSQL2008DBEngineDiscovery.vbs and DiscoverSQL2005DBEngineDiscovery.vbs scripts which contains the following line of code :                   
    tcp = oQuery.ItemIndex(0).PropertyStrVal
    The issue is the ItemIndex is supported only on Vista+ operating systems. The product group is currently investigating and evaluating the issue and I don’t think the fix will be released recently…"
    I guess that meant "any time soon' :)
    I should add that we also upgraded the SQL MPs around this time too, to 6.5.1.0.
    So as you can appreciate, we just have to put up with this for now!
    Cheers

  • How to create power shell script to upload all termset csv files into the SharePoint2013 local taxonomy ?

    Hi Everyone,
    I want to create a powershell script file
    1) Check a directory and upload all termset csv files into the SharePoint local taxonomy.
    2) Input paramaters - directory that containss termset csv files, Local Termstore to import to,
    3) Prior to updating get a backup of the existing termstore (for rollback/recovery purposes)
    4) Parameters should be passed in via XML file.
    Please let me know how to do it.
    Regards,
    Srinivas

    Hi,
    Please check this link
    http://termsetimporter.codeplex.com/
    Please remember to click 'Mark as Answer' on the answer if it helps you

Maybe you are looking for