Monday, November 25, 2013

[OpsMgr 2012] Finding Management Packs from Microsoft Download website using PowerShell ( #OpsMgr2012 #ManagementPack #Powershell )

I guess you already know that page on the Technet where a list of microsoft Management pack is done : Direct link to Technet site.




In March 2013 Stefan Stranger has published a command line to scrape some of the information about Management Packs using PowerShell. Using the line bellow will list provide you the list of management pack and the download link to get it !


$hsg = Invoke-WebRequest -Uri "http://social.technet.microsoft.com/wiki/contents/articles/16174.microsoft-management-packs.aspx"
$hsg.Links | Where-Object {($_.href -like "*http://www.microsoft.com/*download*") -and ($_.outerText -notlike "*Link to download page*") -and ($_.InnerHTML -like "*This link*")} | 
Select @{Label="Management Pack";Expression={$_.InnerText}}, @{Label="Download Link";Expression={$_.href}}

This other command line should provide the publication date and the creator of the publication :

[xml]$hsg = Invoke-WebRequest "http://social.technet.microsoft.com/wiki/contents/articles/16174.microsoft-management-packs/rss.aspx"

$hsg.rss.channel.item | select Title, pubDate, creator

Based on this command line, Stanislav Zhelyazkov wrote a script to download all MPs from the link and create folders by MP name, and subfolders by version 




This posting is provided "AS IS" with no warranties.

No comments:

Post a Comment