• Microsoft Script Explorer for Windows PowerShell (pre-release)

    Today we released the Microsoft Script Explorer for Windows PowerShell (pre-release).

    Microsoft Script Explorer for Windows PowerShell (pre-release) helps scripters find Windows PowerShell scripts, snippets, modules, and how-to guidance in online repositories such as the TechNet Script Center Repository, PoshCode, local or network file systems and Bing Search Repository.

    System requirements

    Supported Operating Systems: Windows 7 Service Pack 1, Windows 8 Consumer Preview, Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2, Windows Server 8 Beta, Windows Vista Service Pack 2

    Additional Requirements:

    • Windows PowerShell 2.0/3.0 ISE (Client computer that is to run Script Explorer as an add-on)
    • Microsoft .NET Framework 4

    Additional information

    This software is a pre-release version. Features and behavior are likely to change before the final release.
    This preview release is designed to enable the community to experience and review the preliminary designs and direction of key features in Microsoft Script Explorer and to solicit feedback before features are finalized. If you have additional questions, need help in troubleshooting issues, and other product features visit the Microsoft Script Explorer Forum on TechNet. Your feedback is important to us. Help improving Script Explorer by submitting bugs and suggestions to Microsoft Script Explorer Forum on TechNet.

    image

     

    image

     

    And start searching for your PowerShell scripts.

    image

     

    Please give use feedback on the Microsoft Script Explorer Forum on TechNet.

    Thanks!

  • OM12 - Creating a Dashboard View with Widgets and store in specific Management Pack

    Today I was playing around with creating some Dashboard Views with Widgets and wanted to store them in their own Management Pack. All the blogs about creating OM 2012 Dashboards store the Dashboards and Widgets in the Default Management Pack. This is by design because all Views (and the Dashboard View is just another view) are created in the folder you started doing it from.

    The only exception to this, is creating a folder (but that’s not a view Winking smile)

    So if you start creating a Dashboard View in the Monitoring folder the Dashboard View is stored in the Default Management Pack.

    image

    If you want to store your Dashboard View in another Management Pack than the Default Management Pack, you need to create a new Management Pack (for example create a Test Management Pack) and start creating your Dashboard View under that (Test) folder.

    image

    Now your Dashboard View is being stored in the Test Management Pack.

     

    More blogposts about creating Dashboard views are:

  • OM12 - Viewing contents Management Pack Bundle files with MPViewer 1.9

    Yesterday I blogged about some small improvements to Daniele Grandini blogpost about a great PowerShell script to dump the contents of Management Pack Bundles (.mpb) files and the old MP contents.

    But did you knew you can do the same with the new MP Viewer Daniele Muscetta created for OM12?

     

    With MPViewer 1.9 you can also view the contents of mpb (MP Bundles). How cool is that?

    image

     

    After you opened the mpb file go to the Resources folder and BOOM! there you see the contents of the mpb files. How cool is that?

    image

    Or some script info like the sql queries

    image

    Go get the latest OM12 tools from Daniele Muscetta’s blogpost.

  • OpsMgr 2012 – how to dump management pack bundles (small “improvement”)

    Last week Daniele Grandini posted a great PowerShell script to dump the contents of Management Pack Bundles (.mpb) files and the old MP contents.

    The script takes just two parameters an input directory where you have to copy MP and MPB files and an output directory where the dumps will be saved. The OpsMgr 2012 admin console needs to be installed for the script to work properly.

    Today I finally had some time to play with OM12 and PowerShell for a session I’m preparing and I also tried to Daniele’s dump management pack bundles PowerShell script. It worked as expected, but the results of the dumped mpb files where stored in the same directory together with all other dumped mpb file contents. And this is not what I wanted.

    image

     

    I would rather have the contents of each dumped mpb file stored in it’s own folder. That way it’s easier to explore the contents of the mpb file IMO.

    So I made some small changes to the PowerShell script Daniele created to have each mpb file dump it’s content in it’s own folder.

    image

    Now it’s easier to see what has been dumped for each mpb file.

    I hope Daniele won’t mind me changing his script slightly to fit my personal preferences Smile 

    Here is my changed version of Daniele’s script:

    param($inDir, $outDir)

    [Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Core")
    [Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Packaging")

    $mpStore = new-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackFileStore($inDir)

    $mps = get-childitem $inDir *.mp
    #$mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter($outDir)
    if ($mps -ne $null)
    {
        foreach ($file in $mps)
        {
            md ($outDir + "\"+ $file)  #ADDED     
            $mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter($outDir + "\"+ $file) #ADDED
            $MPFilePath = $file.FullName
            $mp = new-object Microsoft.EnterpriseManagement.Configuration.ManagementPack($MPFilePath)
            Write-Host $file
            $mpWriter.WriteManagementPack($mp)
        }
    }
    #now dump MPB files
    $mps = get-childitem $inDir *.mpb
    $mpbReader = [Microsoft.EnterpriseManagement.Packaging.ManagementPackBundleFactory]::CreateBundleReader()
    if ($mps -ne $null)
    {
        foreach ($file in $mps)
        {
            md ($outDir + "\"+ $file)  #ADDED     
            $mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter($outDir + "\"+ $file)    #ADDED   
            $mpb = $mpbReader.Read($file.FullName, $mpStore)
            foreach($mp in $mpb.ManagementPacks)
            {
                #write the xml
                $mpWriter.WriteManagementPack($mp)
                $streams = $mpb.GetStreams($mp)
                foreach($stream in $streams.Keys)
                {
                    $mpElement = $mp.FindManagementPackElementByName($stream)
                    $fileName = $mpElement.FileName
                    if ($fileName -eq $null)
                    {
                        $fileName = $outDir +'\' + ($mp.Name)+ '.' + $stream+ '.bin'
                    }
                    else
                    {
                        If ($fileName.IndexOf('\') -gt 0)
                        {
                            #only on dir level supported
                            $dir = $outDir + '\' + $fileName.SubString(0, $fileName.IndexOf('\'))
                            if ([System.Io.Directory]::Exists($dir) -ne $true)
                            {
                                [System.Io.Directory]::CreateDirectory($dir)
                            }
                        }
                        #$fileName = "${outdir}\${fileName}"
                        $fileName = $outdir+"\"+$file+"\$filename" #ADDED
                    }
                    Write-Host "`t$fileName"
                    $fs = [system.io.file]::Create($fileName)
                    $streams[$stream].WriteTo($fs)
                    $fs.Close()
                }
            }
        }
    }

     

    See the comment # for what I changed.

     

    This posting is provided "AS IS" with no warranties, and confers no rights.