• Windows Phone Push Notifications for your OpsMgr Alerts - Part 1

    Did you know you can easily create your own Windows Phone Push Notifications using the Notify My Windows Phone app?

    NMWP is a platform that helps you push information to virtually any Windows Phone 7 (and 8) device you own.

    What do you need to get started?

    1. Windows Phone 7 or 8
    2. The NMWP app from the Microsoft Store ($1.99)
    3. NMWP Api key
    4. PowerShell script to call the Web API

     

    First we need to install the The NMWP app from the Microsoft Store on our Windows Phone. Open the Windows Store app on your Windows Phone and install the app.

    nmwp7

    Next we need to Sign up at http://www.nmwp7.com/user/register and create a username and password.

    image

     

    After registering you need to enter your username and password at the Notify my Windows Phone app on your Windows Phone.

    nmwp7_2

    And at last we need to request an API key on the http://www.nmwp7.com/user/apikeys website.

    image

     

    After requesting the API key you can test the key using the Send testmessage button.

    image

    Hopefully now everything is working as expected.

    Testing Notify My Windows Phone from PowerShell

    If you look at the API help it’s pretty simple to call the API. With PowerShell v3 you can use the Invoke-WebRequest cmdlet to call the Web API.

    A simple PowerShell script to call the Web API can look something like this:

    #Requires -Version 3
    
    #######################################################################################################################                        
    # Using the Notify my Windows Phone API using PowerShell                        
    # Author: Stefan Stranger            
    # Disclamer: This program source code is provided "AS IS" without warranty representation or condition of any kind
    #            either express or implied, including but not limited to conditions or other terms of merchantability and/or
    #            fitness for a particular purpose. The user assumes the entire risk as to the accuracy and the use of this
    #            program code.
    # Date:        01-05-2012                       
    # Name:     NotifyMyWindowPhone.ps1            
    # v0.01 -     01-05-2012 - Stefan Stranger - sstranger's initial release               
    ########################################################################################################################
    
    # Enter your own API Key from http://www.nmwp7.com/user/apikeys
    $apikey = "[enter here your api key]"
    
    # Enter the name of the application the notification originates from. 
    $application = "WindowsPowerShell"
    
    # Enter The event that occured. Depending on your application, this might be a summary, subject or a brief explanation.
    $event = "Push Message sent from PowerShell"
    
    # The full body of the notification. 
    $description = "This message was sent as a test"
    
    # An optional value representing the priority of the notification.
    $priority = "-2"
    
    # Specifies the responsetype you want. You can currently choose between JSON or XML (default)
    $type = "json"
    
    $uri = "http://notifymywindowsphone.com/publicapi/notify?event=$event&priority=$priority&application=$application&description=$description&apikey=$apikey&type=$type"
    
    Invoke-WebRequest -Uri $uri

    If you run above PowerShell script you will see the following result returned in your console.

    image

    Now you would see the push notification on your Windows Phone.

    nmwp7_3

    In my next blog post I’ll explain how you can use above to create Windows Phone Push Notifications for your OpsMgr Alerts using the Notification Command Channel.

    Have fun!

  • Update Rollup 1 for System Center 2012 Service Pack 1

    There is a new Update Rollup 1 for System Center 2012 Service Pack 1 available for System Center 2012 Service Pack 1.

    Issues that are fixed in Update Rollup 1
    App Controller (KB2790935)
    Issue 1
    Copying a .vhd file between Windows Azure storage accounts may be unsuccessful, and you receive a "Retrieved data is complete" warning message. This issue occurs if the .vhd file already exists on the destination or if the .vhd file is mapped to an existing virtual machine.
    Issue 2
    The import of Virtual Machine Manager (VMM) library server certificates may be unsuccessful for VMM library servers that are clustered.
    Data Protection Manager (KB2791508)
    Issue 1
    Client backups fail when there is a case difference between the client computer name on the computer and the client computer name that is stored in Active Directory.
    Operations Manager (KB2784734)
    Issue 1
    Agentless Exception Monitoring (AEM) in Operations Manager may provoke an increase in reporting threads and choke points.
    Issue 2
    After the Alert Attachment Management Pack (Microsoft.SystemCenter.AlertAttachment.mpb) is imported, you create a dashboard that contains an alert widget. When you click an alert, the Operations Manager console may crash.
    Issue 3
    When a Windows PowerShell module uses the Monitoringhost.exe process on an x86-based client that is running Windows 8, more than 800 megabytes (MB) of memory may be consumed.
    Issue 4
    After an application domain is created, adding another application domain may be unsuccessful.
    Operations Manager - UNIX and Linux Monitoring (Management Pack Update)
    Issue 1
    When multiple process monitors are used to target the same computer or group, processes may incorrectly monitor some template instances. Additionally, problems with the monitored processes may not be detected. This issue occurs when each process monitor uses the same name as the process even though different argument filters are used in each process monitor.
    Note After the updated Microsoft.Unix.Process.Library.mpb file is imported, all existing Process Template instances must be edited and saved for the fixed behavior to take effect.
    Service Provider Foundation (KB2785476)
    Issue 1
    The OperatingSystemId property on a virtual hard disk (VHD) object is always set to NULL.
    Issue 2
    Virtual machine usage metrics are not aggregated at hourly intervals and are missing basic usage metrics such as network sent and receive I/O operations per second (IOPS).
    Virtual Machine Manager (KB2792925 - Console; KB2792926 - VMM Server)
    Issue 1
    When a logical unit number (LUN) is unmasked on an iSCSI array, the VMM service may crash.
    Issue 2
    When a node is put in maintenance mode, virtual machines in the cluster change to a status of "Unsupported Cluster Configuration."
    Issue 3
    When an add-in that uses multiple DLL files is imported into the VMM console, the add-in is not imported. Additionally, you receive the following error message:
    Add-in cannot be installed
    Issue 4
    When an add-in is imported into the VMM console on a server that is running Windows Server 2008 R2, the add-in is not imported.
    Issue 5
    When an add-in is imported into the VMM console, the console may crash.
    How to obtain and install Update Rollup 1 for System Center 2012 Service Pack 1
    The update packages for App Controller, Data Protection Manager, Operations Manager, Service Provider Foundation, and Virtual Machine Manager are available from Microsoft Update.
    The UNIX and Linux Monitoring Pack update for Operations Manager is available from the following Microsoft Download Center website:

    http://www.microsoft.com/download/details.aspx?id=29696

    • To obtain and install the update packages from Microsoft Update, follow these steps on a system that has an applicable System Center 2012 component installed:
      1. Click Start, and then click Control Panel.
      2. In Control Panel, double-click Windows Update.
      3. In the Windows Update window, click Check Online for updates from Microsoft Update.
      4. Click Important updates are available.
      5. Select the Update Rollup 1 packages that you want to install, and then click OK.
      6. Click Install updates to install the selected update packages.
    • To manually download the update packages from Microsoft Update Catalog, go to the following Microsoft websites:

      App Controller (KB2790935)
      DownloadDownload the update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2790935)

      Data Protection Manager (KB2791508)
      DownloadDownload the update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2791508)

      Operations Manager (KB2784734)
      DownloadDownload the update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2784734)

      Service Provider Foundation (KB2785476)
      DownloadDownload the update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2785476)

      Virtual Machine Manager (KB2792925 - Console, KB2792926 – VMM Server)
      DownloadDownload the Console update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2792925)

      DownloadDownload the VMM Server update package now.
      (http://catalog.update.microsoft.com/v7/site/Search.aspx?q=2792926)

      To manually install the update packages, run the following command from an elevated command prompt:
      msiexec.exe /update packagename

      For example, to install the Virtual Machine Manager Server Update (KB2792926), run the following command:
      msiexec.exe /update KB2792926-AMD64-Server.msp

     

    Remark: You can also read my blogpost OpsMgr 2012: Update Rollup 3 ships, and my experience installing it, to see what has changed for updates since UR3.

  • Windows Phone Push Notifications for your OpsMgr Alerts - Part 2

    This is part 2 in a two blog post series about configuring Windows Phone Push Notifications for OpsMgr 2012. Please read blog post part 1 first, if you have not read this.

    Disclamer: I’ve this only tested on OM2012 SP1 and you need PowerShell v3 to have the script working.

    In this blog post we are going configure the Notification. These are the high-level steps to configure OM2012 Notifications:

    1. Create the PowerShell script which sends the OM2012 Alerts as Windows Phone Push Notifications.
    2. Create the Command Channel
    3. Create the Subscriber
    4. Create the Subscription
      1. Add the Subscribers
      2. Choose the Command Channel

    Step 1. Create the PowerShell script which sends the OM2012 Alerts as Windows Phone Push Notifications.

    We need to create a PowerShell script which sends the OM2012 Alerts as Windows Phone Push Notifications. We store this script on the Management Server in a location of your own choice.

    In this example I store the WindowsPhonePushNotifications_v0.1.ps1 script in the C:\Scripts folder on the Management Server.

    The script has three parameters which are show in the Windows Phone Push Notifications:

    • Alert Name
    • Alert Severity
    • Alert Time Raised
    #Requires -Version 3
    
    #######################################################################################################################                        
    # Using the Notify my Windows Phone API using PowerShell                        
    # Author: Stefan Stranger            
    # Disclamer: This program source code is provided "AS IS" without warranty representation or condition of any kind
    #            either express or implied, including but not limited to conditions or other terms of merchantability and/or
    #            fitness for a particular purpose. The user assumes the entire risk as to the accuracy and the use of this
    #            program code.
    # Date:     01-05-2012                       
    # Name:     NotifyMyWindowPhone_v0.1.ps1            
    # v0.01 -   01-05-2012 - Stefan Stranger - sstranger's initial release   
    # v0.02 -   01-07-2012 - Stefan Stranger - Added Notification Channel Subscriptions            
    ########################################################################################################################
    
    Param($alertname,$alertseverity,$alertTimeRaised) 
    
    # Enter your own API Key from http://www.nmwp7.com/user/apikeys
    $apikey = "[enter here your api key]"
    
    # Enter the name of the application the notification originates from. 
    $application = "OM2012"
    
    # Enter The event that occured. Depending on your application, this might be a summary, subject or a brief explanation.
    $event = "OM2012 Alert"
    
    # The full body of the notification. 
    $description = @"
        AlertName: $alertname
        AlertSeverity: $alertseverity
        AlertTimeRaised: $alertTimeRaised
    "@
    
    #You can enable the write-eventlog for logging purposes.
    #write-eventlog -LogName Application -source MSIInstaller -EventId 999 -entrytype Information -Message $description
    
    # An optional value representing the priority of the notification.
    $priority = "-2"
    
    # Specifies the responsetype you want. You can currently choose between JSON or XML (default)
    $type = "json"
    
    $uri = "http://notifymywindowsphone.com/publicapi/notify?event=$event&priority=$priority&application=$application&description=$description&apikey=$apikey&type=$type"
    
    Invoke-WebRequest -Uri $uri

    Step 2. Create the Command Channel

    Go to Administration -> Notifications -> Channels and choose New Channel.

    image

    Give your Channel a name. (example Windows Phone Push Notifications)

    Enter the Command Notification Channel Settings.

    Full path of the command file:

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe

    Command line parameters:

    C:\Scripts\WindowsPhonePushNotifications_v0.1.ps1 '$Data/Context/DataItem/AlertName$' '$Data/Context/DataItem/Severity$' '$Data/Context/DataItem/TimeRaisedLocal$'

    Startup folder for the command line:

    C:\Scripts

    image

    Step 3. Create the Subscriber

    Right click "Subscribers" and choose "New Subscriber"

    image

    Enter a easily to identify Subscriber name, like Windows Phone Push Notifications.

    image

    Configure the Schedule.

    image

    Enter a non-existing address

    image

    Configure the Channel

    image

    Click Next, click Finish

    image

    image

    Step 4. Create the Subscription

    We now need to create a new subscription. Right-click on "Subscriptions" and choose New Subscription.

    image

    Enter the Subscription Notification fields.

    image

    Click Next and Configure the Criteria.

    In this test we will configure each alert with a Resolution State of New.

    image

    Click Next and add the previously created Subscriber

    image

    Click Next and add previously created Channel.

    image

     

    Click Next and Finish.

    Now we test our Command Channel with a test Alert Rule and watch our Windows Phone for the Push Notifications.

    If everything is working as expected you will see the following Windows Phone Push Notifications.

    WPPushNotifications 

    image

    Have fun configuring Windows Phone Push Notifications!