Registering Stamp in System Center 2012 Service Provider Foundation

System Center 2012 Service Provider Foundation is a new component introduced in SP1. Actually it is still not with status component because it is included in the installation DVD of System Center 2012 Orchestrator SP1. Nevertheless it seems it will key part of System Center Family. And may be the only reason that is not with status component is probably this product will be developed further a lot more.

So what exactly is SPF?

As you probably know System Center Virtual Machine Manager does not have SDK so SPF is the SDK of VMM. This is of course the short explanation. Basically in order to develop web portal that will expose and interact with VMM data you need some programming language so you can write your code and connect to VMM. As VMM is based on PowerShell developers can actually use PowerShell to do that but PowerShell is not a programing language and this is the problem. Of course there are probably a lot more reasons why PowerShell is not the right way. So Microsoft created SPF that is basically API over a Representational State Transfer (REST) web service and this web service actually uses PowerShell to interact with VMM. REST web service is basically the standard for web services. As I am not developer and I might be in mistake for some of the terms but this is the way I understand it from IT Pro perspective. But the capabilities of SPF doesn’t end here. While the other System Center components have their own SDK each (exception is Orchestrator that have REST web service also) that can be used for developing web portals the SDK isn’t so appealing for web developers. For now SPF currently can be connected to VMM only but there are plans to be able to connect SPF to OpsMgr and DPM. With such plans why not in the distant future see also SPF to be able to connect to Service Manager and Configuration Manager.

With this short description let’s see what is Stamp and how we can connect SPF with VMM?

As there are other people who can describe better than me what is Stamp I will just borrow the description from Technet Wiki:

Management Stamps, or stamp, is a new concept introduced with Service Provider Foundation. A stamp represents a unit of virtualized platform infrastructure that includes System Center Virtual Machine Manager, one or more virtual machine hosts and the virtual machines that are managed in the context of the System Center Virtual Machine Manager instance within the stamp. Each stamp also includes the configuration unique to each stamp such as service accounts and user roles.
Stamps must be capable of being monitored; therefore a stamp also includes an instance of System Center Operations Manager. However an instance of System Center Operations Manager may provide monitoring for multiple stamps so there is not necessarily a 1:1 relationship between the number of stamps and instances of System Center Operations Manager.
Put another way a stamp is an instance of System Center that supports a virtualized platform infrastructure up to the maximum number of virtual machine hosts and virtual machines supported by System Center.

 

With this description in mind you can probably think of that you can use stamps do define different Datacenters. Let’s say have Datacenter in Europe that is managed by one set of System Center components and you have another datacenter in USA that is managed by another set of System Center components. You create two different Stamps for those datacenters so you can connect a different set of System Center to each Stamp. Imagine that you have a global web portal like Windows Azure and from that portal your customers deploy virtual machines. USA customers deploy virtual machines to USA datacenter and Europe customers deploy virtual machines to the Europe datacenter. This distinguishment is based on the Stamps that you have defined.

Now that we know what is Stamp we can create it.

Create the stamp is quite straightforward and it is document in in Technet. It can be done by PowerShell. What is not documented is that you have to import SPF PowerShell module first in order to use the cmlets. So to import open PowerShell as Administrator and execute this:

Import-Module spfadmin

Than in order to create Stamp you first have to create connection to a VMM server. This can be done by executing this command:

$server = New-SCSPFServer -Name "VMMserver.contoso.com" -ServerType 0

In your case please the FQDN of your VMM server instead of VMMserver.contoso.com. By pointing out Servertype 0 you are indiciating it is VMM sever. 1 is for OpsMgr and 2 is for DPM but for now they cannot be used. Next command creates the stamp:

$stamp = New-SCSPFStamp –Name "Stamp_Europe" –Servers $server

spf

You can put whatever name you want for your Stamp. Besides the name when the Stamp is created a unique identifier is assigned to it.

On the Technet link that I’ve provided you can see how you can create tenant, associate that tenant with a stamp and create Tenant Administrator role in VMM based on that Tenat you’ve created in SPF.

Note that by executing the commands for new server and new stamp you are creating records in the SPF database for them.

Definitely SPF is a interesting software that can be the key for the future of System Center family.

Cumulative Update 1 for System Center 2012 Configuration Manager Service Pack 1

Typically System Center 2012 SP1 components receive Update Rollups together at the same time but it seems ConfigMgr is still exception to that. Cumulative Update 1 for System Center 2012 Configuration Manager SP1 is released by MSFT. This update contains several fixes and believe it or not new functionalities in the form of new PowerShell cmdlets:

  • Add-CMDistributionPoint
  • Import-CMAntiMalwarePolicy
  • Import-CMDriver
  • New-CMAppVVirtualEnvironment
  • New-CMMigrationJob
  • New-CMPackage
  • New-CMSoftwareUpdateAutoDeploymentRule
  • New-CMTaskSequence
  • New-CMTaskSequenceInstallUpdateAction
  • New-CMTaskSequenceMedia
  • New-CMUserDataAndProfileConfigurationItem
  • Remove-CMTaskSequenceInstallUpdateAction
  • Set-CMTaskSequenceGroup
  • New-CMTaskSequenceGroup
  • Remove-CMTaskSequenceGroup
  • Set-CMApplicationCatalogWebsitePoint
  • Set-CMAppVVirtualEnvironment
  • Set-CMClientPushInstallation
  • Set-CMClientSetting
  • Set-CMDistributionPoint
  • Set-CMDriver
  • Set-CMEndpointProtectionPoint
  • Set-CMEnrollmentPoint
  • Set-CMEnrollmentProxyPoint
  • Set-CMHierarchySetting
  • Set-CMManagementPointComponent
  • Set-CMOperatingSystemImageUpdateSchedule
  • Set-CMOutOfBandManagementComponent
  • Set-CMReportingServicePoint
  • Set-CMSite
  • Set-CMSoftwareUpdateAutoDeploymentRule
  • Set-CMSoftwareUpdatePointComponent
  • Set-CMStateMigrationPoint
  • Set-CMStatusSummarizer
  • Set-CMSystemHealthValidatorPointComponent
  • Set-CMTaskSequence
  • Set-CMTaskSequenceInstallUpdateAction
  • Set-CMUserDataAndProfileConfigurationItem
  • Start-CMDistributionPointUpgrade

You can find out about the fixes and download CU1 from here.

Backing Up Custom Management Packs in Service Manager

Every SCOM or SCSM specialists knows that backing up custom management packs is one of the most important tasks. Andrew Barton provides a PowerShell script for Service Manager for this task in Partner and Customer Solutions Blog.

Download All Microsoft Management Packs for SCOM 2007, R2 and 2012 in Bulk with PowerShell

Just last week Daniel Savage published a list on TechNet Wiki with all management packs for OpsMgr 2007, R2 and 2012. A couple of days later Stefan Stranger wrote Finding Management Packs from Microsoft Download website using PowerShell and provided a small PowerShell script that provides a list with the management packs from that site and links to them. After reading that post I was wondering wouldn’t be cool if you get the names of all management packs and their links and download all of them with their guides also. And when you download them to be able to organize them in structure that includes the name of the MP and its version. Instead of writing to Stefan I’ve said to myself – What the hell I will try to make that script. I do not have any big experience with PowerShell and it was not easy to built the script but because I’ve managed to create this proves that PowerShell is easy to learn but you have to be persistent. During the creation of the script I’ve noticed that some of the links on the page were incorrect so I’ve corrected them.

In short the script grabs the names and the links for all management packs on the site. Than it goes trough every MP link. From every MP page gets the version of it and all download links (msi, guides and etc.). Than creates a directory for that MP and subdirectory with the version number and downloads all files in it. The script requires PowerShell v3.

Here is the script:

   1: #Get list of all Management packs and their links from Technet Wiki

   2: #Thanks to Stefan Stranger http://blogs.technet.com/b/stefan_stranger/archive/2013/03/13/finding-management-packs-from-microsoft-download-website-using-powershell.aspx

   3: $allmpspage = Invoke-WebRequest -Uri "http://social.technet.microsoft.com/wiki/contents/articles/16174.microsoft-management-packs.aspx"

   4: $mpslist = $allmpspage.Links | Where-Object {($_.href -like "*http://www.microsoft.com/*download*") -and ($_.outerText -notlike "*Link to download page*") -and ($_.InnerHTML -like "*This link*")} |

   5: Select @{Label="Management Pack";Expression={$_.InnerText}}, @{Label="Download Link";Expression={$_.href}}

   6:

   7: #Directory to save the downloaded management packs. Make sure it is created first before running the script

   8: $dirmp = "D:\MPs\"

   9:

  10: #go trough every MP

  11: foreach ($mp in $mpslist)

  12: {

  13: #get MP link

  14: $mplink = $mp.'Download Link'

  15:

  16: #get MP name

  17: $mpname = $mp.'Management Pack'

  18: Write-Host "MP Name:" $mpname

  19: Write-Host "MP Link:" $mplink

  20:

  21: #Read MP page

  22: $mppage = Invoke-WebRequest -Uri "$mplink"

  23:

  24: #Find all download links on the page (mp, guide and etc.). $_.href cannot be used beacuse some of the links require conformation before download

  25: $dws = $mppage.Links | Where-Object {($_.'bi:fileurl' -like "*http://download.microsoft.com/download*") } | Select @{Label="Download Link";Expression={$_.'bi:fileurl'}}

  26:

  27: #Find the version number of the MP on its page

  28: $version = $mppage.ParsedHtml.getElementsByTagName("td") | Where "classname" -contains "col2" | Select -ExpandProperty InnerText

  29:

  30: #Remove character ? in fron of MP version. For some reason some versions of mps start with ?

  31: $version = $version.Replace("?","")

  32:

  33: #Remove / character from MP name if contains it beacuse can create unneeded directories

  34: $mpname = $mpname.Replace("/","")

  35: Write-Host "MP Version:" $version

  36: Write-Host "Download Links:" $dws

  37:

  38: #Create directory with the Name of the MP and subdirecotory with the version of the MP

  39: New-Item -ItemType directory -Path $dirmp\$mpname\$version

  40:

  41: #Get the array of found download links

  42: $dws = $dws.'Download Link'

  43:

  44: #Get trough every download link

  45: foreach ($dw in $dws)

  46: {

  47: #assign download link to $source variable

  48: $source = $dw

  49:

  50: #Get the name of the file that will be downloaded

  51: $Filename = [System.IO.Path]::GetFileName($source)

  52:

  53: #Set directory where the file to be downloaded

  54: $dest = "$dirmp\$mpname\$version\$Filename"

  55:

  56: #initiate client for download

  57: $wc = New-Object System.Net.WebClient

  58:

  59: #download the file and put it in the destination directory

  60: $wc.DownloadFile($source, $dest)

  61: }

  62:

  63: #empy line

  64: Write-Host

  65: }

You can download it from TechNet Gallery also.

Once again thanks to Stefan Stranger.

PowerShell Script to Retrieve Performance Data from SCOM

SCOM 2012 doesn’t offer cmdlet that retrieves performance data but a script made from Brian Wren offers that. The script has several parameters that can be used but you can download and find more about the script directly from MSFT TechNet Gallery.