• Enable ISAPI and CGI Restrictions for Web Console installation using PowerShell DSC

    This week I’m trying to install System Center Operations Manager 2012 R2 using PowerShell Desired State Configuration. I’ve been able to install the Domain Controller and SQL 2012 using DSC but now I was stuck at some of the pre-requisites for the OM2012 R2 installation.

    clip_image002

    I had to add and enable the ISAPI and CGI Restrictions for the successful installation of the Web Console.

    To solve this issue I used the following DSC Script Resource.

    # --------------------------------------------------- # Script: C:\Scripts\PS\OM2012R2Scripts\DSC\5_enableISAPConfig.ps1 # Version: 0.1 # Author: Stefan Stranger # Date: 11/20/2014 10:38:34 # Description: DSC Resource script to add and enable ISAP and CGI for OM12R2 Web Console installation # Comments: Initial version # Changes: # Disclaimer: # This example is provided “AS IS” with no warranty expressed or implied. Run at your own risk. # **Always test in your lab first** Do this at your own risk!! # The author will not be held responsible for any damage you incur when making these changes! # --------------------------------------------------- Configuration EnableIsapiRestriction { Node OM12R2DSC-OM { Script EnableIsapiRestriction { GetScript = { GetScript = $GetScript SetScript = $SetScript TestScript = $TestScript $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" Result = get-webconfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" } SetScript = { $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" Add-WebConfiguration -pspath 'MACHINE/WEBROOT/APPHOST' -filter 'system.webServer/security/isapiCgiRestriction' -value @{ description = 'ASP.NET v4.0.30319' path = $frameworkPath allowed = 'True' } Set-WebConfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" -value 'True' -PSPath:IIS:\ } TestScript = { $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" $isapiConfiguration = Get-WebConfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" ($isapiConfiguration.value -ne $null) } } } } # Compile MOF EnableIsapiRestriction -OutputPath "$Env:Temp\EnableIsapiRestriction" # Make it so! Start-DscConfiguration -Path "$Env:Temp\EnableIsapiRestriction" -Wait -Verbose -Force -ErrorAction Continue

     

    When running above script ISAP and CGI extensions will be added and enabled.

    image

    And the pre-reqs for the web console  are now met.

    image

    Let’s continue with the installation of OM12R2 using the xSCOM Resource Package.

  • Grouping and Sorting in Azure Operational Insights Search

    I’ve been playing with the preview of Azure Operational Insights lately. Operational Insights (http://preview.opinsights.azure.com) is an online service that analyzes installations of Microsoft server software by using System Center Operations Manager or agents directly connected to servers. Operational Insights collects data from your installations, analyzes it, and generates alerts that identify potential issues (such as missing security patches) or deviations from identified best practices with regard to configuration and usage. Operational Insights also provides current and historical views of server configurations in your environment.

    You can find more information about Operational Insights on TechNet.

    Back to the title of this blog post. Today I was trying to Group and Sort the results for missing Update Rollups from the System Update Assessment Intelligence Pack. Intelligence Packs are a collection of logic, visualization and data acquisition rules that address key customer challenges today. They allow deeper insights to help investigate and resolve operational issues faster, collect and correlate various types of machine data and helps you be proactive with activities such as Capacity Planning, Patch status reporting and security auditing.

    image

    When selecting the System Update Assessment on my Operational Insights Overview Dashboard I got the following overview.

    image

     

    As you can see here I have 3 Types of Updates missing and for the Type of Update Rollups I have 11 Update Rollup missing. When drilling down to the Search pane of Operational Insights by clicking on the Update Rollups Type in above windows I see the following results.

    image

    Now I want to group the results by KBID. That’s easy, just pipe above query to Measure by Count() by KBID

    Type:RequiredUpdate UpdateClassification:"Update Rollups" | select UpdateTitle,KBID,UpdateClassification,UpdateSeverity,PublishDate,Server | Measure count() by KBID

    image

    But how would I now sort the group result by KBID ascending?

    Type:RequiredUpdate UpdateClassification:"Update Rollups" | select UpdateTitle,KBID,UpdateClassification,UpdateSeverity,PublishDate,Server | Measure count() by KBID | Sort AggregatedValue Asc

    Remark: AggregatedValue property is case-sensitive! aggregatedvalue or AGGREGATEDVALUE is not working!

     image

    There is small learing curve, especially if you know how to group and sort in PowerShell, but there are some great blog posts from Daniele Muscetta on how to Search in Azure Operational Insights:

    And Stefan Roth published a Microsoft Azure Operational Insights – Search Data Explorer Cheat Sheet which you can also use for exploring the data in Operational Insights.

    Have fun exploring!

  • Real-Time monitoring of OM Techical Preview installation for errors

    Some days ago we announced the availability of Windows Server Technical Preview and System Center Technical Preview.

    After downloading the vhd file using a PowerShell script shared on Niklas Akerlund’s blog I wanted to monitor the installation of OpsMgr in real-time for errors.

    As you may already know there is OpsMgrSetupWizard.log file which reports activity and progress of setup wizard.

    Wouldn’t it be cool if we could monitor this file in real-time for errors? This can easily be done using PowerShell and the Get-Content Cmdlet.

    get-content -Path c:\users\<UserName>\Appdata\Local\SCOM\Logs\OpsMgrSetupWizard.log -tail 2 -wait | select-string -Pattern "error"

    Change the <UserName> to the user which is being used for the installation.

    Here is an example using the Get-Content and Select-String cmdlet to monitor for error message real-time.

    tail

    Have fun installing the preview.

  • Creating a PowerShell Script Gallery Upload ISE Add-On – Part 2

    In part 1 of this blog post series I showed the end result of the PowerShell Script Gallery Upload ISE Add-On which I created. In this post I explain the steps I took to create this ISE Add-On.

    As starting point I used the blog post from Jason Stangroome called Create a PowerShell v3 ISE Add-on Tool.

    The high-level steps are the following:

    1. Open Visual Studio and create a new WPF User Control Library project. The new project should contain a new UserControl1.
    2. Add a new Project Reference to the Microsoft.PowerShell.GPowerShell (version 3.0) assembly located in the GAC.
    3. Open the UserControl1.xaml.cs code-behind file and change the UserControl1 class to implement the IAddOnToolHostObject interface.
    4. Add Browser Object to UserControl1.
    5. Add PowerShell script to load ISE Add-On as reference.
    6. Build Solution.
    7. Open ExamplePowerShellISEAddOn.ps1 from build folder in PowerShell ISE.

    Pre-requisites:

    • Visual Studio (I used Visual Studio Ultimate 2012)

    Step 1. Open Visual Studio and create a new WPF User Control Library project. The new project should contain a new UserControl1.

    image

    Step 2. Add a new Project Reference to the Microsoft.PowerShell.GPowerShell (version 3.0) assembly located in the GAC.

    image

    image

    image

    Step 3. Open the UserControl1.xaml.cs code-behind file and change the UserControl1 class to implement the IAddOnToolHostObject interface.

    Before:

    image

    After:

    image

    Save.

    Step 4. Add Browser Object to UserControl1.

    image

    Search in Toolbox for WebBrowser Control and drag and drop on UserControl1.xaml.

    Go to properties pane for new WebBrowser Control.

    image

    Enter Source.

    image

    Step 5. Add PowerShell script to load ISE Add-On as reference.

    Open PowerShell ISE and save following script with correct folder path to c:\temp\ExamplePowerShellISEAddOn.ps1

    add-type -path "C:\Users\stefstr\Documents\Visual Studio 2012\Projects\ExamplePowerShellISEAddOn\ExamplePowerShellISEAddOn\bin\Debug\ExamplePowerShellISEAddOn.dll" $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('ExampleISEAddOn', [ExamplePowerShellISEAddOn.UserControl1], $true)

    Go back to Visual Studio and add ExamplePowerShellISEAddOn.ps1 add PowerShell script as existing item.

    image

    image

    Step 6. Build Solution.

    image

    Step 7. Open ExamplePowerShellISEAddOn.ps1 from build folder in PowerShell ISE.

    image

    image

    image

    Next steps you could do is improving the WebBrowser Control or adding navigation buttons and code to the ISE Add-On.

    You can also look at Script Gallery ISE Add-On project page for what I’ve added to the WebBrower control.

     

    References:

  • New Operations Manager Dashboard section Script Center

    We recently added an area for sharing scripts for SCOM dashboards featuring PowerShell extensibility widgets to the TechNet Script Center repository. This is a centralized location with PowerShell scripts for the extensibility widgets.

    image

    image

    I’ve uploaded my PowerShell Grid Widget Helper script to this section too. And did you know I also used my PowerShell Script Gallery Upload ISE Add-On to upload my Helper function from within the PowerShell ISE?

     

    image

    Check my script here: http://gallery.technet.microsoft.com/PowerShell-Grid-Widget-226ef153

    Let’s upload your scripts for SCOM dashboards featuring PowerShell extensibility widgets to the TechNet Script Center repository!

    Final tip. You can use the Microsoft Script Browser ISE Add-On to search for those Dashboard script from within the PowerShell ISE.

    image

  • Creating a PowerShell Script Gallery Upload Add-On – Part 1

    Some weeks ago I started a discussion on Codeplex requesting an option to upload your PowerShell scripts to the TechNet Script Center being part of the Microsoft PowerShell Script Browser.

    .One of the main features in the Script Browser is to search, download, and learn script examples from the TechNet Script Center.

    image

    Until now most of the scripts I create are shared on Github.Mainly because it’s pretty simple to upload scripts to my Github repository. But the more scripts I and you upload to the Microsoft Script Center the more scripts can be found using the Script Browser.

    So instead of waiting for some responses on my discussion thread on Codeplex I tried to create a PowerShell ISE Add-On which makes it easier to upload your scripts from the PowerShell ISE to the Script Center.

    image

    The wish list for this ISE Add-On was the following:

    1. You must be able to easily upload your PowerShell script from PowerShell ISE. Easily means without leaving the ISE and not having to type to much information on the Upload page.
    2. You must be able to navigate on the Upload page from within the ISE
    3. You must be able to insert the file name into the File Upload text box with one click
    4. You must be able to insert as much as possible information available in the script to the Description field.
      As much as possible means the Script Comment Header information I always insert at the top of my PowerShell scripts.

    After reading below documentation I created a beta version of the PowerShell Script Gallery ISE AddOn on Github.

    You can test this beta version if you want.

    Steps:

    1. Download the v0.1-beta.zip file from the release folder.
    2. Unblock v0.1-beta.zip file.
    3. Extract v0.1-beta.zip to folder of choice.
    4. Run LoadScriptGalleryISEAddOn.ps1 from within the ISE.

    In the next part of this blogpost I’ll describe the steps I followed to create this PowerShell ISE Add-On.

     

    References:

  • Using PowerShell OData Provider Module for OneGet and PowerShellGet

    After playing with OneGet and PowerShellGet for some time now I wanted to dive into the OData feed that both new PowerShell v5 preview features are using.

    Let me first summarize OneGet and PowerShellGet.

    OneGet is a new way to discover and install software packages from around the web. With OneGet, you can:

    • ·Manage a list of software repositories in which packages can be searched, acquired, and installed
    • · Search and filter your repositories to find the packages you need
    • · Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command

    This first version of OneGet installs and searches software from Chocolatey repositories.  Support of additional repositories will come in subsequent versions.

    PowerShellGet is a new way to discover, install, and update PowerShell Modules.  New in WMF 5.0 Preview May 2014, PowerShellGet contains a set of cmdlets that enable users to interact with an online module gallery.Instead of having to search through CodePlex, GitHub, various blogs, and TechNet Script Center for all the PowerShell Modules you want, you can use Find-Module to search through an online Gallery

    Both use an OData feed, Open Data Protocol (OData) is a data access protocol initially defined by Microsoft. The protocol was designed to provide standard CRUD access to a data source via a website. If you want to learn more about OData just go to wikipedia.

    Now we know, we can access the OneGet and PowerShellGet repositories using an OData feed we can use the PowerShell OData Explorer. With the 'OData Explorer' PowerShell application we can browse the OData Services. After downloading and unzipping the OData Explorer we need to add the two OData Services from OneGet and PowerShellGet in the ODataServices.csv file.

    PowerShell OData Explorer

    image

    image

    Name, uri
    NetFlix,    "http://odata.netflix.com/Catalog"
    Northwind,  "http://services.odata.org/Northwind/Northwind.svc/"
    TechEd2010, "http://odata.msteched.com/sessions.svc/"
    WorldCup,   "http://www.openligadb.de/Webservices/OData.svc/"
    StackOverflow, "http://odata.stackexchange.com/stackoverflow/atom"
    SuperUser, "http://odata.stackexchange.com/superuser/atom"
    ServerFault, "http://odata.stackexchange.com/serverfault/atom"
    "Meta StackOverflow", "http://odata.stackexchange.com/meta/atom"
    Locations, "http://ogdi.cloudapp.net/v1/dc"
    Chocolatey, "http://chocolatey.org/api/v2/"
    Nuget, "http://www.nuget.org/api/v2/"
    PowerShellget, "https://msconfiggallery.cloudapp.net/api/v2/"

    Open the .\View-OData.ps1 PowerShell script and start browsing.

    image

    You can browse the Chocolatey or NuGet OData feed for the OneGet Packages or for the PowerShell Modules you can browse the PowerShelGet OData feed.

    image

    After browsing through the OneGet and PowerShellGet OData repositories would not it be cool if we can “just” navigate those OData feeds like we do with our other PowerShell Providers?

    OData PowerShell provider

    This can be done using the PowerShell OData Provider Module. The OData PowerShell provider allows you to mount OData feeds as drives in your powershell session. This enables simple and intuitive access to the catalogs, collections, and entities in the feed using the same cmdlets you use for working with files. Download, unzip and install the PowerShell OData Provider and get started navigating your OneGet and PowerShellGet OData feed just like any other PowerShell Provider.

    001
    002
    003
    004
    005
    006
    007
    008
    009
    010
    011
    012
    013
    014
    015
    016
    017
    018
    019
    020
    021
    import-module OData

    #Get-Help on OData queries
    get-help about_OData_Query

    #Create an new OneGet Drive
    New-PSDrive -Name OneGet -PSProvider OData -Root "http://chocolatey.org/api/v2/"

    #Go to OneGet Drive
    cd OneGet

    #Search for latest 7zip package
    get-childitem OneGet:/packages -orderby Version -filter "Title eq '7zip'" -top 1

    #Create an new PowerShelGet Drive
    New-PSDrive -Name PowerShellGet -PSProvider OData -Root "https://msconfiggallery.cloudapp.net/api/v2/"

    #Search top PowerShell Module downloads from PowerShellGet Repository
    get-childitem PowerShellGet:/packages | 
       
    where-object {$_.Islatestversion -eq "$true"} | 
       
    select-object name, @{Label="Downloads";Expression= {[int]$_.Downloadcount}}| sort Downloads -Descending

    image

    Have fun browsing those PowerShellGet and OneGet OData feeds using the PowerShell OData Provider Module.

  • What is my in PowerShell Profile?

    This week Ed Wilson (Hey Scripting Guy) shares information about what people have in their Windows PowerShell profile.

    Interested to know what I’ve in myPowerShell profile? Check the following blog post called  “What’s in Your PowerShell Profile? Microsoft PFEs' Favorites

    Go update your Profile!

  • OpsMgr Program Managers on Twitter

    I guess you already know I’m pretty active on Twitter but since recently an number of OpsMgr (Program) Managers have joined the Twittersphere. You can now start following them on Twitter and ask them to improve your favorite products Winking smile

    Joseph Chan (Principal Program Manager

    Daniele Muscetta (Program Manager)

    Daniel Savage (Principal Program Manager)

    Liz Kim (Program Manager)

    Sacha Dawes (Business Manager)

    For your convenience I also created a Twitter List for the OpsMgr Program Managers

    If I’m someone missing please let me know.

    See you on Twitter Smile

  • PowerShell Grid Widget Helper

    I already blogged about the new PowerShell Grid Widget which came with the release of UR2 for System Center 2012 R2 where we included updates for the Widgets which allow you to create richer dashboard visualization within Operations Manager.

    If you look at the Walkthrough I created, there is a part where you need to create the PowerShell script that is being used for the PowerShell Grid Widget.

    The creation of the PowerShell script was not as straight forward as I would liked it to be. Would not  it be great if you could just have a PowerShell function where you would input your normal PowerShell script and which would generate the script needed for the PowerShell Grid Widget on the fly?

    I created a function that creates the script for the PowerShell Grid Widget with only a limited number of parameters.

    Let’s walk through a scenario.

    Scenario:
    Create a PowerShell Grid Widget for the top 10 OpsMgr Error eventlogs on the server where you have the console running in the last 24 hours.

    You would normally first start with a PowerShell script that retrieves the top 10 OpsMgr Error eventlogs on the Server where you have the Console running for the last 24 hours.

    Get-EventLog -LogName "Operations Manager" -After ((Get-Date).AddHours(-24))| where-object {$_.Entrytype -match "Error"} | Select-Object EventId,Source,Message | Group-Object EventId | Select-Object * -ExpandProperty Group | Select-Object count, EventId, Message -Unique | Sort-Object Count -Desc | Select-Object -first 10

    This would result in the following:

    image

    After we created the script we need to “store” our “normal” PowerShell script in a scriptblock and pass this to our new Show-PSGridWidgetCode helper Function and finally pipe the result to the clipboard so we can copy the script to the Console.

    $scriptblock = {Get-EventLog -LogName "Operations Manager" -After ((Get-Date).AddHours(-24))| where-object {$_.Entrytype -match "Error"} | Select-Object EventId,Source,Message | Group-Object EventId | Select-Object * -ExpandProperty Group | Select-Object count, EventId, Message -Unique | Sort-Object Count -Desc | Select-Object -first 10 } Show-PSGridWidgetCode -scriptblock $scriptblock -id Message | clip

    image

    image

    Result:

    image

    If you want to start playing with the new PowerShell Helper Function Show-PSGridWidgetCode you need to save the following script as PowerShellGrid.ps1

    # --------------------------------------------------- # Script: D:\PowerShellGrid_v0.3.ps1 # Version: 0.4 # Author: Stefan Stranger # Date: 05/19/2014 21:19:49 # Description: PowerShell Grid Widget Helper Function # Comments: With the latest OM2012 UR2 update new Dashboard Widgets have been added. # This helper function helps with the creation of the PowerShell script code needed Grid Widget # Links: http://blogs.technet.com/b/stefan_stranger/archive/2014/04/28/new-powershell-grid-widget-walkthrough.aspx # Know issues: # - First object in returned array will be used as ID property [solved] # - If a property of an object has multiple values this will not displayed correctly [solved] # Changes: [04-30-2014]: Added new Id Parameter. This should be an unique property of the objects # [05-19-2014]: Added string type to all output objects # Disclaimer: # This example is provided “AS IS” with no warranty expressed or implied. Run at your own risk. # **Always test in your lab first** Do this at your own risk!! # The author will not be held responsible for any damage you incur when making these changes! # --------------------------------------------------- Function Show-PSGridWidgetCode { <# .Synopsis Create Script code for use in new OM12R2 UR2 PowerShell Grid Widgets. .DESCRIPTION The output of this function can be copied to the Operations Manager Console to create the script code for creating the new PowerShell Grid Widgets. .EXAMPLE Show-PSGridWidgetCode -scriptblock {Get-Service | Select Name, Status} This command show the script code needed to create a PowerShell Grid Widget showing the Windows NT Services properties Name and Status on the machine where the console is running. You can copy the output to the console to have a head start creating the new Widget. PS C:\Scripts\PS> Show-PSGridWidgetCode -scriptblock {Get-Service | Select Name, Status} -Id "Name" $inputobject = Get-Service | Select Name, Status foreach ($object in $inputobject) { $dataObject = $ScriptContext.CreateInstance("xsd://foo!bar/baz") $dataObject["Id"] = ($object.Name).ToString() $dataObject["Name"] = ($object.Name).ToString() $dataObject["Status"] = ($object.Status).ToString() $ScriptContext.ReturnCollection.Add($dataObject) } #> [CmdletBinding()] Param ( # Inputobject parameter [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$false, Position=0)] [scriptblock]$scriptblock, # Name parameter [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$false)] [string]$id ) $properties = ((&$scriptblock | Get-Member -MemberType Properties).name) #Find properties with a collection of objects foreach ($property in $properties) { $property = $property -join "," $testherestring = @" `$dataObject["$property"] = [String](`$object.$property) "@ [string]$total += "$testherestring`n" } $script = @" `$inputobject = $scriptblock foreach (`$object in `$inputobject) { `$dataObject = `$ScriptContext.CreateInstance("xsd://foo!bar/baz") `$dataObject["Id"] = [String](`$object.$id) $total `$ScriptContext.ReturnCollection.Add(`$dataObject) } "@ $script }

    After saving the script you need to dot source the script (start the script like this . .\PowerShellGrid.ps1) (dot space dot)

    Now you can call the Show-PSGridWidgetcode Function from within PowerShell. I also added help for the Function.

    PS C:\Scripts\PS\OM2012\PowerShellGridWidget> help Show-PSGridWidgetCode -full
     
    NAME
        Show-PSGridWidgetCode
       
    SYNOPSIS
        Create Script code for use in new OM12R2 UR2 PowerShell Grid Widgets.
       
    SYNTAX
        Show-PSGridWidgetCode [-scriptblock] <ScriptBlock> -id <String> [<CommonParameters>]
       
       
    DESCRIPTION
        The output of this function can be copied to the Operations Manager Console to create the
        script code for creating the new PowerShell Grid Widgets.
       
     
    PARAMETERS
        -scriptblock< ScriptBlock>
            Inputobject parameter
           
            Required?                    true
            Position?                    1
            Default value               
            Accept pipeline input?       false
            Accept wildcard characters?  false
           
        -id <String>
            Name parameter
           
            Required?                    true
            Position?                    named
            Default value               
            Accept pipeline input?       false
            Accept wildcard characters?  false
           
        <CommonParameters>
            This cmdlet supports the common parameters: Verbose, Debug,
            ErrorAction, ErrorVariable, WarningAction, WarningVariable,
            OutBuffer, PipelineVariable, and OutVariable. For more information, see
            about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
       
    INPUTS
       
    OUTPUTS
       
        -------------------------- EXAMPLE 1 --------------------------
       
        PS C:\>Show-PSGridWidgetCode -scriptblock {Get-Service | Select Name, Status}
       
       
        This command show the script code needed to create a PowerShell Grid Widget showing the
        Windows NT Services properties Name and Status on the machine where the console is running.
        You can copy the output to the console to have a head start creating the new Widget.
        PS C:\Scripts\PS> Show-PSGridWidgetCode -scriptblock {Get-Service | Select Name, Status} -Id "Name"
             $inputobject = Get-Service | Select Name, Status
             foreach ($object in $inputobject)
             {
                 $dataObject = $ScriptContext.CreateInstance("xsd://foo!bar/baz")
                 $dataObject["Id"] = ($object.Name).ToString()
                             $dataObject["Name"] = ($object.Name).ToString()
                 $dataObject["Status"] = ($object.Status).ToString()
                 $ScriptContext.ReturnCollection.Add($dataObject)
             }
       
       
       
       
       
       
    RELATED LINKS

    The ID parameter is used for the property that is being used as the unique key that is used in the PowerShell Grid Widget.

    Another example for retrieving SCOM Alerts with some filter criteria.

    $scriptblock = { Get-SCOMAlert -Criteria "ResolutionState = 0 AND Severity = 2 AND IsMonitorAlert = 1 AND (Owner <> 'Stefan' OR Owner IS NULL)" | Select Name, Severity, Priority, TimeRaised, ResolutionState } Show-PSGridWidgetCode -scriptblock $scriptblock -id Name | clip

    image

    Disclaimer:
    This example is provided “AS IS” with no warranty expressed or implied. Run at your own risk.
    The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.

    **Always test in your lab first**  Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!

  • TechEd North America 2014 OpsMgr Content

    TechEd North America is provides technical education, product evaluation, and community resources to plan, architect, deploy, manage and secure a connected enterprise. The brightest and most skilled technology professions meet to increase their technical expertise through deep hands-on technical learning, sharing of best practices and interaction with Microsoft and a variety of industry experts and their peers.

    Here is an overview of all currently available content about System Center Operations Manager.

    Building Highly Effective Dashboards in Microsoft System Center 2012 R2 Operations Manager

    This session covers the brand new innovations in the Operations Manager dashboard infrastructure that allows you to build custom dashboards for any audience.

    Overview and Enhancements in Microsoft System Center 2012 R2 Operations Manager

    This session provides an overview of the most stable enterprise monitoring product available today and the new innovations that arrived in R2 and since. This session also features a panel discussion with members of the System Center Product Group.

    Microsoft System Center 2012 R2 Operations Manager: Mastering Historical Monitoring Data

    Many monitoring metrics can be used to analyze your infrastructure. Want to know how user activities impact your LOB applications? Need to plan future capacity? Think of moving to the cloud? There is no reason to allow blind guessing where knowledgeable decision can be made.

    Effective Capacity Planning of Your Infrastructure Resources with Microsoft System Center 2012 R2…

    The information you need to make the right choices about how you plan capacity for your private and public cloud infrastructure is at your fingertips in the data that you collect with Operations Manager. All you need to know is how to best utilize the Operations Manager datawarehouse, reporting, dashboarding.

    Monitoring SQL Server with Microsoft System Center 2012 R2 Operations Manager

    Take a deep dive into monitoring Microsoft SQL Server with System Center 2012 R2 Operations Manager, System Center 2012 R2 Advisor and protection with System Center 2012 R2 Data Protection Manager. This session is focused on the application SQL Server and how we can keep it in tip top condition.

    Extending Microsoft System Center 2012 R2 Operations Manager

    This session covers how Operations Manager as a platform has been extended with System Center Advisor to provide Operational Intelligence about customers’ environments by capturing their operational/machine data into a big data store in Azure.

  • Interesting announcements during TechEd North America 2014

    I don’t know if you have noticed but we are this week hosting our TechEd North America 2014 event in Houston, Texas.

    TechEd North America is Microsoft’s premier technology conference for IT Professionals and Enterprise Developers, providing the technical education, product evaluation, and community resources to plan, architect, deploy, manage and secure a connected enterprise.

    While not being present on TechEd I tried to follow some of the interesting announcements made. These are the ones I found most interesting.

    Operations Manager Announcements:

    • Microsoft System Center Advisor – Limited Public Preview.
      System Center Advisor is an online service that analyzes installations of Microsoft server software. Advisor collects data from your installations, analyzes it, and generates alerts that identify potential issues (such as missing security patches) or deviations from identified best practices with regard to configuration and usage. Advisor also provides both current and historical views of the configuration of servers in your environment.

      This new preview we are introducing an new Dashboard based on HTML5 and we introduce Intelligence Packs. We even have a gallery which contains these “intelligence packs” which contain rich knowledge and visualizations for capacity planning, security, diagnostics, and configuration assessment.

      System Center Advisor – Limited Preview gathers data from your on-premise installation and provides rich intelligence. There is no hardware, software, or applications to install, manage or upgrade – everything is cloud-based.

    Sign up here: https://preview.systemcenteradvisor.com/

    Azure Announcements:

    PowerShell Announcements:

    This new package installs exclusively on Windows 8.1 and Windows Server 2012 R2. 

    PowerShellGet is a new way to discover, install, and update PowerShell Modules.

    If you have not yet downloaded or installed WMF 5.0 Preview May 2014 you should do it now.

    I already downloaded and installed the preview and it’s so cool to be able to discover and install new PowerShell modules.

    image

    image

    And while this was not an official announcement Jeffrey Snover introduced PowerShell DSC for Linux.
    image

    How cool is this? Smile

    In case you missed some of the interesting new from TechEd I suggest you go to our Channel 9 video channel and start watching some of the great sessions.

    I already suggest you watch the following sessions on Channel 9:

    Windows PowerShell Unplugged with Jeffrey Snover

    Come learn PowerShell the way PowerShell was meant to be learned—exploring Windows from the console. In this session, Distinguished Engineer Jeffrey Snover starts with the Get-Help cmdlet and shows you the tools and techniques to teach yourself PowerShell. Jeffrey’s contention is that most people still haven’t realized the power of what was delivered in PowerShell V1 so advanced users are likely to learn as much as day zero beginners.

    Channel 9 Live: Windows Azure Pack Automation

    Symon Perriman with Charles Joy

    Channel 9 Live: The Differentiated IT Professional

    Rick Claus with Jeffrey Snover, Distinguished Engineer

    Channel 9 Live: Microsoft Azure with Mark Russinovich

    Rick Claus with Mark Russinovich, Technical Fellow.

    Windows PowerShell Best Practices and Patterns: Time to Get Serious

    Based on results from the 2013 Scripting Games and a summer-long community engagement, this session presents the practices and patterns that the Windows PowerShell community has identified as the most important for creating stable, performant scripts and tools.

    Let’s start with those first Smile

    Have fun!

  • New PowerShell Grid Widget Walkthrough

    With the release of UR2 for System Center 2012 R2 we included updates for the Widgets which allow you to create richer dashboard visualization within Operations Manager.

    More information about the new list of Widgets can  be found here: http://social.technet.microsoft.com/wiki/contents/articles/24133.operations-manager-dashboard-widgets.aspx

    One of the more interesting new Widgets in my opinion are the PowerShell Grid Widgets:

    • PowerShell Grid Widget
    • PowerShell Web Browser Widget

    The PowerShell Grid Widget displays the results of a Windows PowerShell script in a grid.  The script is run when the dashboard is opened and each time the component is refreshed. 

    The script will run on the computer with the console and will typically use the Operations Manager SDK (not in this walkthrough) to access a management server and retrieve information from the management group.  It must then use the ScriptContext object to create a Data Object and return it using the ReturnCollection method.

    The PowerShell Web Browser Widget displays the output of a web page retrieved by a PowerShell script.  The script is run when the dashboard is opened and each time the component is refreshed.

    The script will run on the computer with the console and should create a Data Object using Request type defined in Microsoft.SystemCenter.Visualization.Component.Library.WebBrowser.Schema.  You specify the Url by setting the BaseUrl property.  The request is sent to the site and the resulting output delivered to the dashboard when the ReturnCollection method of the ScriptContext object.

    In this blog post I will guide you through the creation of PowerShell Grid Widget to retrieve the latest blog posts from the System Center: Operations Manager Engineering Blog using PowerShell to retrieve the RSS feed for this blog.

    Step 1: Create a New Dashboard and Widget

    image

    Select the layout for this dashboard. In this case we are going to have a single cell dashboard

    image

    Step 2: Add a Widget to Dashboard created above

    image

    Select the PowerShell Grid Widget

    image

    After entering the General Properties for the Widget we need to add the PowerShell script we are going to use for the Grid

    image

    [xml]$Feeds = Invoke-WebRequest -Uri "http://blogs.technet.com/b/momteam/atom.aspx" $Entries = $Feeds.feed.entry | select title, @{LABEL="Published"; EXPRESSION={[datetime]$_.Published} } | Sort-Object -Property Published -Descending foreach ($Entry in $Entries) { $Title = $Entry.title $Published = $Entry.published $dataObject = $ScriptContext.CreateInstance("xsd://foo!bar/baz") $dataObject["Id"] = $Title.ToString() $dataObject["Title"] = $Title $dataObject["Published"] = $Published $ScriptContext.ReturnCollection.Add($dataObject) }

    Save the Grid and open the Dashboard in the Monitoring Pane of the Console

    image

    If you want to learn more about using the new Widgets part of the new UR2 for OM2012 R2 you can download the Word document attached at the New Widgets and Dashboard blog post.

    Have fun exploring the new Widgets and Dashboards!

    Disclaimer:
    This example is provided “AS IS” with no warranty expressed or implied. Run at your own risk.
    The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.

    **Always test in your lab first**  Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!

  • Viewing NuGet Packages with the NuGet Explorer

    You may have seen that we released the the Windows Management Framework V5 Preview and that one of the new features  is Windows PowerShell OneGet. OneGet is designed to dramatically simplify how you discover and install software packages.

    Windows PowerShell OneGet

    OneGet is a new way to discover and install software packages from around the web. With OneGet, you can:

    • · Manage a list of software repositories in which packages can be searched, acquired, and installed
    • · Search and filter your repositories to find the packages you need
    • · Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command

    This first version of OneGet installs and searches software from Chocolatey repositories.  Support of additional repositories will come in subsequent versions.

    What is Chocolatey?

    Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built with Windows in mind.

    What is Nuget?

    NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.

    One of the things that comes getting up in discussions about using Chocolatey Packages with or without OneGet is the question how can I trust the Packages from a resource like Chocolatey? The Chocolatey Nuget Packages are build by the community so you need to be careful what you are downloading and installing like all other software from sources you don’t own yourself.

    But what if there is a easy way to view the content of NuGet Package before installing the Chocolatey NuGet packages? And that is possible using the NuGet Package Explorer.

    The NuGet package explorer tool which lets you view the metadata of a .nupkg package. After installing it, you can double click on .nupkg packages to open them in Package Explorer.

    After installing the NuGet Package Explorer you can choose what to do.

    image

    Let’s open a package from the Online Chocolatey Feed.

    image

    Search the Package you are interested in to install. (like 7zip)

    image

    Click on open

    image

    Select the chocolateyInstall.ps1 file and right-click

    image

    Select View Content

    You can now see all the metadata that’s within the Chocolatey NuGet Package of 7zip.

    image

    Do you now have enough info to decide if you want to install 7zip using Chocolatey or the new OneGet Module?

    References:

  • Are you attending TechEd 2014? Interested in meeting with the OpsMgr Product team?

    The System Center: Operations Manager Engineering Blog posted a blog post with a survey.

    “We wanted to gauge our OpsMgr Customers interest in doing an informal round table discussion with OpsMgr product team to influence the future of this product.

    If you are planning to attend TechEd 2014 in Houston could you please take this quick survey to let us know. If there is enough interest we will setup a meeting and details on this event will be posted to this blog site.”

    Go to the blog post and answer the survey if you are interested.

  • Top Support Solutions for System Center 2012 Operations Manager

    Did you know we have a blog about the Top Support Solutions from our Support Engineers? There you can also find the Top Support Solutions for System Center 2012 Operations Manager.

    There is not only a blog where you can search for the Top Support Solutions for different products but now there is also app available in the Windows Store.

    The app is available for free on the Windows Store, and connects users to product posts on the Top Support Solutions blog. These posts contain our best content associated with our top support topics.

    View in Windows Store

    image

  • New release from Silect: MP Author SP1

    Yesterday Silect released a new version of their MP Authoring tool targeted to IT Pros. This tool is called MP Author and is completely free for all System Center Customers and will be the tool we recommend to IT Pros who need to do MP Authoring.

    It replaces previous tools we have piloted such as the Visio Authoring Tool which will be no longer recommended or supported.

    I did a short first test and one of the things working in this version is editing the XML Smile

    image

    There are probably more improvements I’ve not checked but make sure you download this new version from their website!

    Also check my previous blog post about this great tool.

  • Dutch Windows Management User Group event on 12 February 2014

    On the 12th of February 2014 the Dutch Windows Management User Group (WMUG NL) is organizing an event about Monitoring.

    I’ll also present a session about this topic Smile

    Session title: Using PowerShell with System Center Operations Manager 2012 R2

    Description:  Introduction on how to use PowerShell to manage System Center Operations Manager 2012 R2.
    In this session we walk through the PowerShell System Center Operations Manager 2012 R2 module and learn some basic PowerShell. We start with a short introduction to PowerShell and learn how to use the Operations Manager PowerShell cmdlets.

    If you are interested to attend this event please visit the Windows Management User Group website. (in Dutch)

    Hope to see you there or on some other event.

  • New Windows PowerShell Best Practices book by Ed Wilson

    Warning! This is a shameless plug to buy the latest version of Ed Wilson’s Windows PowerShell Best Practices book. Smile

    But I’ve a great reason because I made a very small contribution to the book and I’m pretty proud to say the least.

    image

    And to make it an even better deal you can get a discount on the eBook.

    Use discount code: WKPWERS
    This deal expires January 31, 2014 at 5:00am PT and cannot be combined with other offers. Offer does not apply to Print, or "Print & Ebook" bundle pricing.

    Go check it out on O’Reilly.

    Have fun!

  • Free System Center 2012 R2 Operations Manager Management Pack training from MVA

    Want to expand your knowledge about service packs? In this course, Microsoft experts will drill down into the structure, implementation, and development of management and service packs and their tools. There will be a series of 28 modules with staggered release dates, so keep checking back for new modules to become available.

    Go to the Microsoft Virtual Academy and start this course.

    Have fun!

  • New tool for MP Authoring

    As may or may not have read on the MP Author website Microsoft has decided to partner with Silect to create a MP Authoring tool targeted to IT Pros. This tool is called MP Author and is completely free for all System Center Customers and will be the tool we recommend to IT Pros who need to do MP Authoring.

    It replaces previous tools we have piloted such as the Visio Authoring Tool which will be no longer recommended or supported.

    Software Prerequisites

    •   System Center Operations Manager Console 2012 or above must be installed

    In this blog post I walk you through the installation steps after you have downloaded the MP Author tool and some MP creation steps. You can also review the BridgeWays_MP_Author_Installation_Guide and BridgeWays_MP_Author_User_Guide PDF Guides that come with the installation.

    Steps:

    1. Unzip MPAuthor.zip file
    2. Run MPAuthorSetup.exe

    Step 1. Unzip File

    image

    image

    Steps 2. Run MPAuthorSetup.exe

    image

    Click Yes

    image

    Click Next

    image

    Accept License Agreement and click Next

    image

    Enter Folder to store application and click Next

    image

    Click Install

    image

    Hit finish

    Open MP Author as an Admin

    image

    image

    image

    image

    This will help you get started with the creation of your Management Packs.

    Let’s create a new Management Pack with an Event Monitor.

    Steps:

    1. Click on New in MP Author Console
    2. Follow the Wizard
    3. Save MP
    4. Import Management Pack

    image

    image

    Click on Next

    image

    Enter the config needed for the Manifest section of the MP and click on Next.

    image

    Enter folder to store you MP and click on Next

    image

    Add needed references and click Next

    image

    Choose the Template you want to use for creating your MP and click on Next

    image

    Define the Role the MP will monitor

    Let’s only monitor Gold servers, which we retrieve from a registry value.

    image

    image

    Click on Browse

    image

    Select Registry we want to use and click on OK.

    image

    image

    Identify registry target and click on Next

    image

    Click on Next

    image

    Enter expression and click on Next

    image

    Enter Discovery Schedule and click Next

    image

    Click on Finish

    Continue with the Monitor creation

    image

    Click Next

    image

    image

    Select Event Monitor

    image

    Click Next

    image

    Specify Unhealthy Event and click Next

    image

    Specify Health timer or Event and click Next

    image

    Click Next

    image

    Specify Health States and click Next

    image

    Specify if an Alert needs to be created and Click Next

    image

    Click Finish

    image

    You can add more monitors are click Next to continue

    image

    Choose Rollup Algorithm and click Next

    image

    Click Finish to finalize MP.

    image

    We can verify the MP using the tools and we can also run the Best Practices Analyzer.

    image

    image

    Let’s import the MP

    image

    image

    image

    image

    image

    We can check in the Discovered Inventory for the Target we specified in the MP.

    image

    And finally an Alert is shown after creating the Event in the Eventlog.

    image

    Hope you enjoy this new tool.

    References:

  • Windows Azure Pack–Where to start?

    The Windows Azure Pack is a collection of Windows Azure technologies available to Microsoft customers at no additional cost. Once installed in your datacenter, the Windows Azure Pack integrates with System Center and Windows Server to help provide a self-service portal for managing services such as websites, Virtual Machines, and Service Bus; a portal for administrators to manage resource clouds; scalable web hosting; and more.

    If you want to learn more about Windows Azure Pack (WAP) where do you need to start? The best place to start is the Microsoft Technet wiki page for WAP

    And to make it even easier I would suggest you to watch the 1:14 minutes video Building Cloud Services with Windows Server 2012 R2, Microsoft System Center 2012 R2 and the Windows Azure Pack recorded during TechEd Europe 2013.

    It has some great demos about Azure Consistent Experiences, Virtual Machines, VM Clouds Administration,Automation (SMA), Usage Metering and Service Reporting.

    After watching this video you should be able to understand more about WAP and related concepts like Service Management Automation.

    The Windows Azure Pack is free if you have licenses for System Center and Windows Server.

  • First look at Dell’s Mobile IT solution with Operations Manager Mobile Pack

    Today I listened to the 252st Episode of the  PowerScripting Podcast with Chris Ashley and Dmitry Petrashev from Dell on Mobile IT and PowerGui and wanted to test their Mobile IT Solution with System Center Operations Manager.

    According to their website Mobile IT makes it easy to provide secure, easy-to-use, mobile access to everyday applications that enhance the productivity of your mobile workforce.

    With the product’s unique mobile connector, you can quickly enable your users to access applications from a broad range of mobile devices. Mobile IT delivers a native device experience without the need for either virtualization or custom development all without sacrificing security or usability. With Mobile IT, devices communicate through a secure HTTPS connection, and administrators can easily approve or disapprove devices attempting access as well as lock out devices reported lost or stolen.

    In this blog post I will walk you through the installation of the Mobile IT Components which was pretty easy if you have a simple scenario using Dell’s Gateway to connect to your Mobile IT Server and Agent.

    High-Level Installation steps:

    1. Download Dell Mobile IT bits
      1. Mobile IT x64 with Prerequisites
      2. Microsoft System Center Operations Manager (SCOM)
      3. Release Notes
      4. Administrator Guide
    2. Installation of Mobile IT Components
      1. Installation Mobile IT Server and Agent
        For pre-reqs see Administrator Guide
    3. Installation of Operations Manager Mobile Pack
    4. Installation of Windows Phone Mobile IT App and configuration
    5. Configuration of the Mobile IT Connector within Operations Manager

    Architecture of Mobile IT Solution:

    • Mobile IT Server
      Provides a connection between Mobile IT Agents and your mobile devices, and is usually installed on a dedicated computer with access to the Internet
    • Mobile IT Agent
      Works with the target system (such as GPOADmin, Server Management, TFS, etc.) and communicates with Mobile IT Server
    • Mobile Packs
      Mobile Pack includes functionality for working with a particular system
    • Mobile IT Client
      App for Android, iOS,Windows Phone, and Windows 8 devices that allows the user to communicate with Mobile IT Server

    Test Mobile IT Server\Agent Architecture:

    • Windows Server 2008 R2
    • System Center Operations Manager 2012 Management Server
    • SQL Server 2008 R2

    Simple Scenario

    Taken from Admin Guide

    clip_image001

    Installation of Mobile IT Server\Agent

    1. Unzip Quest_Mobile-IT-x64-with-Prerequisites_13.zip (439 MB)

    clip_image002

    2. Run QuestMobileIT_x64_1.3.2139.0.exe on Mobile IT Server\Agent (System Center Operations Manager Management Server)

    clip_image003

    clip_image004

    clip_image005

    clip_image006

    Selected Full install

    clip_image007

    clip_image008

    On the Management Server is already a SQL Server 2008 R2 Instance installed.

    clip_image009

    image

    image

    clip_image012

    clip_image013

    clip_image014

    clip_image015

    clip_image016

    3. Install Mobile Pack by unzipping Quest_Microsoft-Systems-Center-Operations-Manager-SCOM_118880.zip file

    clip_image017

    4. Import SCOM Mobile Pack using the Mobile IT Console

    image

    clip_image019

    image

    Click on Add Instance

    image

    5. Connect Mobile Devices (Windows Phone) to Mobile IT Server

    1. Launch the Mobile IT application on your mobile device and tap Sign In
      image
      image
      image

      image
    2. Approve device in Mobile IT Console

    image

    6. Configure the Mobile IT Connector
    image

    image

    image

    image

    image

    image

    image

    image

    And now waiting for the Operations Manager Alerts being forwarded to my Windows Phone. And yes Alerts are showing up on my Windows Phone 8 Smile

    image

    image

    image


    Conclusion:

    Installation process of the Mobile IT solution was pretty simple and straightforward, but I was missing information about the configuration of the Mobile IT Connector within Operations Manager.

    I hope find some time to start creating my own Mobile Packs using PowerShell. The Mobile IT development team has released the SDK that can be used by other product development teams to create their own Mobile IT server connectors.

    References:

  • Free ebook: Introducing Microsoft System Center 2012 R2

    Yesterday we released a new free ebook called Introducing Microsoft System Center 2012 R2.

    image

    Microsoft System Center is one of the three pillars of Microsoft’s Cloud OS vision that will transform the traditional datacenter environment, help businesses  unlock insights in data stored anywhere, enable the development of
    a wide range of modern business applications, and empower IT to support  users who work anywhere while being able to manage any device in a secure and consistent way. The other two pillars of the Cloud OS are, of course, Windows
    Server 2012 R2 and Windows Azure, and Microsoft Press has recently released free Introducing books on these platforms as well.
    Whether you are new to System Center or are already using it in your  business, this book has something that should interest you. The capabilities of each component of System Center 2012 R2 are first described and then demonstrated
    chapter by chapter. Real-world and under-the-hood insights are also provided by insiders at Microsoft who live and breathe System Center, and those of you who are experienced with the platform will benefit from the wisdom and experience
    of these experts. We also included a list of additional resources at the end of each chapter where you can learn more about each System Center component.

    Go download the free ebook here

    Was it useful?
    Did it teach you what you wanted to learn?
    Was there room for improvement?
    Let us know at http://aka.ms/tellpress
    Your feedback goes directly to the staff at Microsoft Press,
    and we read every one of your responses. Thanks in advance!

    :

  • What is SMA and why is it important in the world of PowerShell?

    One of the many blogposts on my todo list is about SMA (Service Management Automation) but I’m just too busy to blog right now. So sorry for the lack of blogposts lately. Did I mention we are looking for Premier Field Engineers in the Netherlands? Winking smile

    Service Management Automation is a feature of the management portal for administrators in Windows Azure Pack for Windows Server. You can use it to automate administrative tasks in the management portal. You automate your tasks by using runbooks, which run Windows PowerShell commands. You can also use a runbook to run another runbook within its workflow. When the secondary runbook is finished, runbook implementation returns to the calling runbook.

    Jim Britt a Senior Program Manager for the Windows Server System Center CAT Team at Microsoft has posted a blogpost the PowerShell Magazine blog explaining what SMA is and why it is important in the world of PowerShell.

    Check it out!