Third question - Using parameters in powershell recovery - Alert description

Hi guys,
With help i created powershell recovery in a management pack. Once again thanks very much, this is new to me. Now i know these parameters (variables):
http://blogs.technet.com/b/kevinholman/archive/2009/09/23/alert-notification-subscription-variables-and-linking-that-to-the-console-database-and-sdk.aspx
But how can i implement this in this XML? I think i must declare them in the XML, because when i put the variable there, it doesn't work. I would like to get the alert description in the message variable (see xml below)
</Recovery>
<Recovery ID="MomUIGenaratedRecovery28e1547022254ccbb82784c60d51b1d2" Accessibility="Public" Enabled="true" Target="Type603f92b7b83945598af55495615db953" Monitor="UIGeneratedMonitor0cd347f57f3949deb958cebb02d25555" ResetMonitor="false" ExecuteOnState="Error" Remotable="true" Timeout="300">
<Category>Custom</Category>
<WriteAction ID="MomUIGenaratedModule75df98fbfc5b48e39fd605cccd97d29b" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<ScriptName>sendSMS.ps1</ScriptName>
<ScriptBody>
# function SendSMS
# PowerShell function to send SMS messages via the CM SMS Gateway.
function SendSMS{
param([string]$url, [int]$customer, [string]$login, [string]$password, [string]$recipient, [string]$sender,[string]$reference)
$xml = New-Object XML
$messages = $xml.CreateElement("MESSAGES")
$customerxml = $xml.CreateElement("CUSTOMER")
$customerxml.SetAttribute("ID", $customer)
$messages.AppendChild($customerxml)|Out-Null
$user = $xml.CreateElement("USER")
$user.SetAttribute("LOGIN", $login)
$user.SetAttribute("PASSWORD", $password)
$messages.AppendChild($user) |Out-Null
if (!($reference.Equals(''))) {
$refxml = $xml.CreateElement("REFERENCE")
$refxml.Innertext = $reference
$messages.AppendChild($refxml) |Out-Null
$tariff = $xml.CreateElement("TARIFF")
$tariff.InnerText = 0
$messages.AppendChild($tariff) |Out-Null
$msg = $xml.CreateElement("MSG")
$from = $xml.CreateElement("FROM")
$from.InnerText = $sender
$msg.AppendChild($from) |Out-Null
$to = $xml.CreateElement("TO")
$to.InnerText = $recipient
$msg.AppendChild($to) |Out-Null
$body = $xml.CreateElement("BODY")
$body.SetAttribute("TYPE", "TEXT")
$body.InnerText = $message
$msg.AppendChild($body) |Out-Null
$messages.AppendChild($msg) |Out-Null
$xml.AppendChild($messages) |Out-Null
Write-Output $xml.OuterXml
$webClient = New-Object net.WebClient
return ($webClient.UploadString($url, $xml.OuterXml))
# test
SendSMS -url 'https://website.sms.nl/webservice.ashx' -recipient 0031612345678 -customer 1 -login 1 -password 'password' -sender 'Standby' -message 'Here i want the alert description' -reference '1234'
</ScriptBody>
<TimeoutSeconds>60</TimeoutSeconds>
</WriteAction>
Kind regards,
André

Parameters are defined between ScriptBody and TimeoutSeconds like this:
<Parameters>
<Parameter>
<Name>param1</Name>
<Value>$Config/param1$</Value>
</Parameter>
<Parameter>
<Name>param2</Name>
<Value>$Config/param2$</Value>
</Parameter>
</Parameters
This information is available on MSDN.
Jonathan Almquist | SCOMskills, LLC (http://scomskills.com)

Similar Messages

  • How can I add SCOM 2012 Alert Context within a SCOM Alert When using a cusom powershell script in a two state monitor?

    Hello, we have a two state monitor and I would like to channel the Alert Context to Alert Description.
    The powershell script being used to find the stopped services is pasted below:
    $API = new-object -comObject "MOM.ScriptAPI" 
    $bag = $api.CreatePropertyBag()
    $ServiceStatus = Get-WmiObject -class win32_service |where {$_.startmode -eq'Auto'-and $_.State -eq 'Stopped' -and
    $_.name -ne 'wuauserv'}
    if (!$ServiceStatus) #if there are no automatic services that are stopped, we are healthy.
    write-host "good"
    $bag.addvalue("State","good")
    if ($servicestatus) #if there are any automatic services that are stopped, we are unhealthy.
    write-host "bad"
    $bag.addvalue("State","bad")
    foreach ($service in $servicestatus) #enumerate the stopped services
    $bag.addValue("$($Service.Name):","$($Service.state)")
    $bag
    $API.Return($BAG)
    The results of the services that are stopped are being captured in the Alert Context”. How can I pipe the Alert Context to “Alert Description” to obtain a meaningful alert?
    Alert Context data:
    Property Name                              Property Value
    State                                                  
    bad
    clr_optimization_v4.0.30319_32: Stopped
    clr_optimization_v4.0.30319_64: Stopped
    How can I pipe to Alert Description in SCOM 2012?
    Thanks,
    Kapil Dham
    Kapil Dham

    you don't need write-host
    you should create
    $bag.addvalue("ServiceName1","StateOK")
    $bag.addvalue("ServiceName2","StateStopped")
    and in alert description you will see
    ServiceName1  
    StateOK
    ServiceName2  
    StateStopped
    So try $bag.addValue($Service.Name,$Service.state)
    and $Data/Context/Property$

  • Using parameters in graphic builder

    hi
    i want to know , how can i use parameters in graphic builder ?
    thanks

    Maybe you would be better to ask such a question in Forms.
    Cheers, APC

  • How to use the rescue and recovery, and the product recovery discs ?

    Hi everyone,
    I've just recently became a new owner of a T61, and really enjoying it. I haven't had a chance yet to test-drive the lenovo phone support, as I have not yet screwed anything up that bad that required their help. I did try a clean factory reinstall from the service partition and it worked great. I would like to find out, how does one use the rescue and recovery startup disc, and the product recovery discs that I created myself? From my previous experience with Dell and HP, I only had to insert the first one and restart the computer, and the rest followed. But with ThinkPads, if I ever wanted to bring it to a clean factory state using those discs, do I use rescue and recovery first, followed by the product recovery? I'm curious, what is the difference between the two? 
    T61 (7658CTO), T9300, 3GB, 250GB, XP Pro
    Solved!
    Go to Solution.

    blake_ibm wrote:
    Hi! I'm blake
    There is no diff between the two... One is on  the Hard Drive and the other on CD/DVD.
    Having the HDD version (pre-installed) is a good for trouble shooting.  It uses a whole diff O/S on a whole diff partition (not C.
    So if you are having problems and boot to RnR (via F11), and those problems go away. you know your issue is software related. If you still have the same problems probly Hardware related...  IT IS AN EFFECTIVE WAY TO TAKE WINDOWS OUT OF THE PROBLEM.
    Other then that. You can re-image another HDD from disks, you can't do that with the F11 version.
    dose all that make sense?
    Hi blake_ibm,
    Thanks. All this makes perfect sense to me, but that's not what I'm asking for. My question is this: if I wanted to bring my notebook to its factory shipped condition using my recovery cd's, how do I do that? Do I insert cd1 first and then restart the notebook, or do I just insert it without restarting it, or perhaps I should use first the rescue and recovery?
    You said that there is no difference between the two, but what two are you talking about man? I am not comparing cd recovery to partition recovery. I am talking about rescue and recovery cd, with system recovery cd's. These are the two things that I'm talking about.
    I'm really grateful for all replies, but please people, read the question first !!!
    I would really appreciate if someone could explain the steps involved in performing a clean factory recovery, using the cd's, and not the recovery partition. I just want to know for the future, in case one day I have to do it. That is all I'm asking.
    T61 (7658CTO), T9300, 3GB, 250GB, XP Pro

  • Export and save a Crystal Report in PDF using parameters

    Hi @all!
    Is it possible to suppress the output of an Crystal Report in a window using parameters? Instead of that I want to save the pdf in a specified folder without using the publication-function.
    Fot the parameter I use these link:
    [http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/boe_sdk/boesdk_dotnet_doc/doc/boesdk_net_doc/html/Report_Linking13.html]
    Best regards,
    Dirk

    Hi,
    this is the forum for the SAP Integration Kit. I would suggest you post your question into the Crystal Reports forum.
    the answer - yes you can use OpenDocument to show the report right away as PDF.
    Ingo

  • Link two reports using parameters

    Hi,
    We are using business object XI.
    I am trying to link two reports using parameters. I cannot use subreport option becuase inside the subreport I should link another report too. So,
    Report 1(High level summary)
    Report 2(Middle level summary)
    Report 3(Detail level)
    I tried to use hyperlink option and used following string.
    http://<server_name>/<Virtual Directory>/object.rpt?prompt0={?param1}&prompt1={?param2}
    Here is my question.
    1. Server name: Does it include port number??
    2. Virtual Directory: I am absolutely lost. I tried the "frsinput" directory the actual rpt file is storing. It is not working.
    Do you have general path??
    3. Parameters: I have 5 parameters to pass. 3 of them are Strings and the rest are DateTime.
    Basically, I need any tutorial about this kinds of things. The tutorial I have got only discribe link like "www.yahoo.com"
    BTW, is this even possible solution??

    Hi,
    I am trying to link two reports in the crystal report designer->deploy to the server->show in the DHTML viewer.
    When I create a URL from report A, it looks like "&" disapears. For example, I created a hyper link from report A using formula,
    http://server:port/........openDocument.jsp?sDocName=reportB&sType=rpt&paramName1="Trim(ToText({?param1},"#####"))"&paramName2="+Trim(ToText ({?param2},"#######"))
    But when I see the actual URL, all the "&" disappears so it looks like
    http://server:port/........openDocument.jsp?sDocName=reportBsType=rptparamName1="Trim(ToText({?param1},"#####"))"paramName2="+Trim(ToText ({?param2},"#######"))
    No wonder it is not working.
    I guess I need special protection for "&" sign. Do you know any?

  • Call javascript function using parameters cause a immediate execute at load

    Hello.
    I recognized a strange behavior if I try to use parameters to javascript in af:clientListener method property.
    Using syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="OnInitControl1" type="click"/>
    </af:commandButton> and javascript function OnInitControl1() {
      alert('OnInitControl1 called');
    } the method OnInitControl1 is called first with the click of the button.
    But with the syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="InitCtrl('Control1')" type="click"/>
    </af:commandButton> and javascript function InitCtrl(frameName) {
      alert('InitCtrl(' + frameName + ') called');
    }the function InitCtrl is called immediate at load of the page.
    In both cases the javascript file is inserted in af:document using<af:resource type="javascript" source="/ScriptHelper.js"/>Is my syntax for "method" property of the af:clientListener wrong?
    Paul.

    Hi,
    I am using Oracle JDeveloer version 11.1.1.0.2. I have gone through your discussion. Since i am new to ADF, just wanted to request you to share the code related to <af:resource type="javascript" source="/ScriptHelper.js"/>. Also, the Tag included for the same. In my Environment, if i use <af:resource, it shows, "element af: resource is not expected".
    My requirement is similar to your as you explained in details. I need to push all the client side validation to Javascript file and need to call in the ADF pages wherever it is required (re-usable). Also, is there any specific formate for JS file to be maintained from the point of view of ADF calling the JS file.
    Your help will be greatly appreciated.
    Thanks in Advance,
    --Mahesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • DPM 2012 Failed to update permissions used in end-user recovery

    Hello everyone,
    I'm going to try the clearest way possible to describe the problem.
    Our test server is Windows Server 2012 with DPM 2012 SP1 CU2 (BKP-SRV01) with a Remote SQL server 2012 (PBASC)
    I protected a share folder on a DC on Windows Server 2008 R2 (PAD)
    When I activate End-User Recovery I get a warning in the monitor tab that say this
    Failed to update permissions used for end-user recovery on pad. Permissions update failed for the following reason: (ID 3123)
    DPM is unable to enumerate contents in pad_PartageTest on the protected computer BKP-SRV01. Recycle Bin, System Volume Information folder, non-NTFS volumes, DFS links, CDs, Quorum Disk (for cluster) and other removable media cannot be protected. (ID 38 Details:
    the end user recovery is working, but i do not know if it affect other things. I also get that message when i try to browse on the DPM server when creating a protection group
    When I go see the DPM Server / File and Storage Services / Shares on Server Manager i get  "Failed to retrieve folder permission" in the properties of the Protected server share.
    I tried to search for almost 2 days without finding anything about that particular issue.
    Is there a way (clean way) to fix the issue?
    Thanks in advance for the help!

    Closing for housekeeping.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This
    posting is provided "AS IS" with no warranties, and confers no rights.
    That's not very helpful. I've got the same issue :(
    Comes up for servers where a protection group related to it errors out (recovery point failure usually).

  • SCOM Powershell get alert count for specific groups

    Hello good people,
    im looking for a powershell script (to use in powershell widget):
    ive got 3 groups which generate alerts, for example group1 group2 group3
    now i need to get all new alerts and closed alerts per group
    groupid  new  closed
    group1    12     100
    group2    10       50
    group3    3         6
    thx for your help in advanced

    you may consider using the following powershell cmdlet to count number of closed alert
    $gp1closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group1'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp1open=get-scommonitoringobject|where-object{$_.displayname -eq 'group1'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    $gp2closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group2'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp2open=get-scommonitoringobject|where-object{$_.displayname -eq 'group2'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    $gp3closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group3'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp3open=get-scommonitoringobject|where-object{$_.displayname -eq 'group3'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    'Group1' + '  '+ $gp1open + '  '+ $gp1closed
    'Group2' + '  '+ $gp2open + '  '+ $gp2closed
    'Group3' + '  '+ $gp3open + '  '+ $gp3closed
    Roger

  • Question on Parameters

    Hi,
    I have a subreport and it has 2 procedures attached to it.  The first procedure accepts clientID and LOB and the second procedure accepts policyid and policyimage... The policy and the policy image is got from the first procedure.
    The way i have set the up parameters is the first parameters clientid and lob are entered by the user and for the third and fourth paramters..
    I have the set avaible values to the the first data and then selected the policy field for the value and label and set the default value to 0 or NULL. I have done the same thing for the 4 parameter selected the policyimage as the label and value.
    The issue I am running into is when the first dataset returns no rows... it is giving me an error saying policy is need even though I am setting the default value to 0 or null (tried giving 0 and Null but still get the same error)
    How can i fix this error.. any help is appreciated.
    Thanks
    Karen

    Hi Karen,
    Based on your description, did you add cascading parameter in the report? The third and fourth parameters is depend on the first and second parameters.
    If I understand correctly, the issue is if there have no data return by the first and second parameters, it will have no values to be select in the third and fourth parameters. It will let us to select a value for the corresponding parameter. In this situation,
    please refer to the steps below to resolve the issue:
    Double click the third parameter.
    Select “Allow null value” option in the General dialog box.
    Click Default Values in the left pane.
    Click “Add” icon and fill with “Null” value.
    Use the same method to configure the fourth parameter.
    If there are any misunderstanding, please elaborate the issue for further analysis.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Use parameters in the folder

    I am new to Discoverer, so please excuse me if this is a dumb question.
    Right now, we have a table that is populated through a load procedure that runs at night. This is a kill-and-fill process which just runs a SELECT statement and inserts the results into a table. Many rows are created from this.
    The Discoverer report I am looking at just queries the table for the data using parameters. Simple and easy.
    However, I would really like to eliminate the load procedure all together and just use a pipeline function which gets the same information... and faster.
    I would like to change the SQL statement being used now to the one using the pipeline function. In order to do this, I would need to pass in the parameters from the report into the SQL statement (date range and other things).
    Is this possible?
    I appreciate everyones time to read this.

    Hi,
    There are two techniques you can use to pass parameters through to the table function that is referenced in a view mapped into the EUL.
    1. Join your table function to a table. For example, if you want to pass EMPNO into your table function then you can create your view like this:
    CREATE OR REPLACE VIEW pipedview AS
    SELECT e.empno, t.*
    FROM emp e, TABLE(your_function(e.empno)) tThen you can create a empno parameter based on the empno column in the view. This method only works if you have a tightly controlled list of values for your parameters.
    2. Use database contexts. Define a database context namespace and use a separate worksheet to set the database contexts. Check out some of these threads on how to use contexts with Discoverer:
    Re: Implementing HR report in Discoverer
    Re: Passing multiple parameters into Custom Folder...
    Re: Parameters in SubQuery
    Re: Passing Parameters to a discoverer folder using Note 282249.1
    Then create your view like this:
    CREATE OR REPLACE VIEW pipedview AS
    SELECT * FROM TABLE(your_function(SYS_CONTEXT('DISCO_CONTEXT','EMPNO'))) tYour users will have to ensure that the context has been set before the reporting worksheet is run.
    Rod West

  • Another downgrade to XP question, using R&R cd.

    I have the sl300, and thinking to downgrade to xp.
    Few questions:
    If I use the included cd to downgrade to windows xp:
    - will it also create those partitions like "servicev003" ?
    - will the installation be packed with software (all the thinkvantage software?), or will it be a clean OS, just windows?
    I really do want to downgrade, but don't want to put all the work in the downgrade to find out a windows xp packed with software and partitions I don't use.
    moderator note: title specified.
    Message Edited by Agotthelf on 25-03-2009 10:00 PM

    hansv wrote:
    I have the sl300, and thinking to downgrade to xp.
    Few questions:
    If I use the included cd to downgrade to windows xp:
    - will it also create those partitions like "servicev003" ?
    - will the installation be packed with software (all the thinkvantage software?), or will it be a clean OS, just windows?
    I really do want to downgrade, but don't want to put all the work in the downgrade to find out a windows xp packed with software and partitions I don't use.
    If the WinXP CDs in the R&R package for the sl300 are anything like the ones for the 3000 n200, then you MUST do some preparation first.
    1. on your ThinkPad, go to ThinkVantage -> Create Recovery Media  and use the info on this page to create your Vista R&R disc set.
    How do I create Recovery CDs using ThinkVantage Rescue and Recovery  - http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-70804 
    2. Make backups of all the data you want to protect.
    3. Make sure you have WinXP installers for all the applications you use.
    4. Once you've made your set of Vista discs; and made your data and app installs backups, then use the WinXP R&R discs to upgrade from Vista to WinXP.
    Downgrading from Windows Vista to Windows XP  - http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=VSTA-DWNGRD
    ALL pre-existing HDD partitions will be destroyed when using either set of the R&R discs.
    The WinXP R&R CDs will setup your system as though it had shipped from Lenovo as a WinXP system. 
    A WinXP recovery partition will be created. 
    WinXP versions of the shovelware will be installed.
    Once you've done the upgrade using the R&R discs, then you can boot into the restore partition, use the Factory Restore option in Custom mode to select how to restore the OS; and deselect some of what shovelware gets installed.
    Would have been better if Lenovo had put ALL the shovelware as being able to be not installed, though.
    Jenifur Charne
    Lenovo 3000 N200 0769A64 owner.

  • Reopen last used tabs in Powershell ISE

    Hi Scripting Guys
    I use a lot of tabs in Powershell ISE console in my work, as an Administrator, and every time I close the ISE I need to reopen every tabs that I used before. So my question is:
    When I open Powershell ISE can it automatically reopen last tabs, that I used? Can Powershell ISE remember that last used tabs like IE can remember last open browser session?
    Best regards,
    Thorkell

    Hi,
    I do this by killing the ISE process with process explorer instead of closing the window. The next time you open the ISE it will note that it didn't shut down properly and will reopen the tabs you had open previously.
    I'm not aware of a graceful way to do this though.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)
    kill $PID -Force
    I've done this a few times to keep my tabs when I open up ISE another time. :)
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Using the FIM PowerShell Module to Remove a Manager

    Just added a sample for using the FIM PowerShell module to
    Remove a Person's Manager.

    Hello,
    Modify this script as per your requirement. This script will help you to get all broken permission from site list and items.
    http://manditech.wordpress.com/2011/08/05/finding-lists-and-items-with-unique-permissions-broken-inheritance/
    To remove group permission, look at here:
    http://sharepoint.stackexchange.com/questions/70071/need-to-remove-permission-level-from-a-sharepoint-group-using-powershell
    http://stackoverflow.com/questions/2278289/remove-unwanted-user-permissions-from-sharepoint
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Error while Driving a view using parameters from other view

    Hi,
    I have created a report with streamlist and Barchart view.Driving option is used in streamlist to drive the barchart. The driving works well untill i dont use any filters in the Streamlist.Once i use parameters in streamlist , the driving works only for the default values set.When Second set of values are chosed for the parameter,the values are displayed correctly , but once they are selected for driving,the current values are replaced by the results of the default parameter settings.
    I have already done the tutorials for driving and it worked well untill i use filters in the main view,from where the driving is done.
    I would really appreciate if someone could give a solution for this problem.
    Regards,
    Lathika

    Hi,
    Login as i.e. sys as sysdba. Standard password is change_on_install.
    Or you can login in using user that has CREATE VIEW WITH ADMIN OPTION and then grant CREATE VIEW privilege to user to want.
    Peter D.

Maybe you are looking for

  • Why does it take 22 phone calls and leaving BT to ...

    I used to have BT broadband option 3.  For this I required a phone line, I made around 3 phone calls a year from it. Last year in May some bright spark in BT decided to merge my phone and broadband accounts.  I had been paying the correct amount of a

  • XI to Bw error

    Hi Gurus,   I am getting following error message when the data is been sent XI to BW system. TCODE: SXMB_MONI Error during XML => ABAP conversion (; error ID: ; ( )) PARSE_APPLICATION_DATA Error during XML => ABAP conversion (Request Message; error I

  • MTR Sync error in Initial Synchronization

    Getting the below error in inital Sync for MTR application SR 05 on MI 2.5 SP 21. Confirmation Details Customizing Tables Due to a communications error method WAF_TRIP_GET_CUSTOMIZING could not be executed Synchronization failed Please let me know, i

  • Streaming to iTunes, makes Wireless intermittant?

    Hi, I stream music from iTunes to my Express (but I also have tried to my Apple TV - which I thought was causing the problem initially), however, sometimes, not for a few hours, the wireless will simply stop working. It's still connected with full si

  • Difference between OB08 and OBBS

    I want to maintain the exchange rate between currency CLP and HUF. on that context I want to know what is the difference between the tcodes, OB08(Currency exchange rates) and OBBS(currency translation). What appeared to me was, exchange rate and curr