Author Archive | Jonathan

Failed to process extensions for management pack: {0} – Invalid enumeration mapping

If you run in to the following problem (read the error message below) when exporting a Service Manager 2012 unsealed MP from one environment and importing it to another installation. Try the solution below.

Please use this approach with care. The solution will remove some connections in SCSM. Therefore test in development environment before using it in production.

Error message

The management pack import failed.
Errors (1):
Failed to process extensions for management pack: {0}
: Failed to process extensions for management pack: ManagementPack.0987654321234567890…
Invalid enumeration mapping
 
Failed to process extensions for management pack1

Solution

This solution solved my problem.

Make a copy of the exported MP and delete the lines between <Extensions></Extensions> in the MP (XML file) and try importing it again.

Screenshot of <Extensions> before deleted lines.

Failed to process extensions for management pack2

Screenshot of </Extensions> before deleted lines.

Failed to process extensions for management pack3

After deleting the lines between the Extensions part it should look like this.

Failed to process extensions for management pack4

After deleting the lines, import the edited MP. When the edited MP has been successfully imported, import the original MP again and hopefully it will import successfully.

 

0

Request a shared folder in System Center 2012 Configuration Manager Application Catalog

I had a crazy idea of requesting a shared folder in the SCCM 2012 Application Catalog. I am not sure when this could be useful but I wanted to see if it could be done.

Below I have described two solutions for this. One more supported then the other 🙂

I will use Orchestrator to generate the folder and the SCCM 2012 Application Catalog for requesting the folder. In this example there will not be any approval needed.

Configuration Manager 2012

Screenshot of Configuration Manager Application Catalog and how the “Create Shared Folder” request will be displayed in the catalog. To be able to get the user requesting the folder I will use the SCCM “Request Approval” feature.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog1

The application in SCCM is almost totally empty because it will only be used for displaying the request in the Application Catalog. This is a screenshot of the SCCM application.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog2

Request a shared folder in System Center 2012 Configuration Manager Application Catalog3

For the Deployment Type I will not use any “Content location” or Program. For Detection Method I will check for the C:\Windows directory as the picture below shows.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog4

For Deployment the “Required administration approval…” will be checked as mentioned earlier.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog5

Runbook

In Orchestrator I will use a Runbook that reads the SCCM 2012 database for new application requests. When it finds a request for “Create shared folder” it will execute the request and create the folder. After creating the folder it will change the request to “Denied” in SCCM 2012 with PowerShell so that a user can request a new folder if needed. I would have loved to change it to something ells but the limitation in PowerShell and SCCM 2012 makes this the best choice. This is the Runbook for getting the SCCM request, creating the folder and changing the status of the SCCM request. To run the Runbook the Orchestrator, the Integration Pack PowerShell Script Execution 1.1 needs to be installed.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog6

I will also publish an alternative Runbook that will delete the row when the request been handled. I think this is a nicer way of handling the request but because it will be changes in the SCCM database it is not supported.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog7

Database

In both Orchestrator Runbooks the following table will be accessed and changed.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog8

To see the different states the request can be in, have look in the following table.

Request a shared folder in System Center 2012 Configuration Manager Application Catalog9

 

Download Runbook: Request a shared folder in System Center 2012 Configuration Manager Application Catalog

0

List applications in Configuration Manager 2012 with PowerShell

This is a short post on how to list the applications with PowerShell in SCCM 2012.
Run the following in a PowerShell window.

Import-Module ‘C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1′

Set-Location <site code>: (example: Set-Location P01:)

Get-CMApplication | Select-Object LocalizedDisplayName,SoftwareVersion,NumberOfDeployments

Screenshot of results.
List applications in Configuration Manager 2012

5

Create Request Offering with PowerShell in Service Manager 2012

This is an step by step example on how to create a Service Offering with PowerShell. Before running the PowerShell commands install SMLets and import the module into the PowerShell prompt.

# Some variables
$OfferingOwner = “User01”
$PublishedBy = “User01”
$MPName = “Example”
$TemplateDisplayName = “Example”
$ROName = “Example”
$RONotes = “Created by PowerShell”
$RODescription = “Example”

# Get the MP where the Request Offering will be placed
$MP = Get-SCSMManagementPack -Name $MPName

# Get the Template that should be added to the Request Offering
$ObjTemplate = Get-SCSMObjectTemplate -DisplayName $TemplateDisplayName

# Create questions for the Request Offering.
# The Prompt is the User Prompts or Information.
# The TargetPath is the Map Prompts.
# The Type is the Configure Prompts.
$QU = @()
$QU += @{Prompt = “Question One”; TargetPath = “Title”; Type = “String”}
$QU += @{Prompt = “Question Two”; TargetPath = “Notes”; Type = “String”}
$QU += @{Prompt = “Question Three”; TargetPath = “UserInput”; Type = “InlineList”; ListElements = “one”}
$QU += @{Prompt = “Question Four”; TargetPath = “RequiredBy”; Type = “DateTime”}
$enum = Get-SCSMEnumeration ServiceRequestAreaEnum$
$QU += @{Prompt = “Question Five”; TargetPath = “Area”; Type = “List”; EnumerationList = $enum}

# Prepare the questions for adding them to the Request Offering
$Qlist = @()
foreach ($Q in $QU)
{
$Qlist += New-SCSMRequestOfferingQuestion @Q -ea Stop
}

# Get the publisher user from SCSM
$ROPublishedBy = get-scsmuser.ps1 | where {$_.DisplayName -eq $PublishedBy}

# Get the offering owner from SCSM
$ROUser = get-scsmuser.ps1 | where {$_.DisplayName -eq $OfferingOwner}

# Create the input for the new Request Offering
$RO = @{
ManagementPack = $MP
Questions = $Qlist
DisplayName = $ROName
Title = $ROName
TargetTemplate = $ObjTemplate
Notes = $RONotes
BriefDescription = $RODescription
Owner = $ROUser
PublishedBy = $ROPublishedBy
Status = $published
PublishDate = (get-date)
# Image = Get-IconStream $ICON
# NoCommit = $true
}

# Create Request Offering
New-SCSMRequestOffering @RO

4

Change status in Service Manager 2012 with PowerShell

If you need to change the status of a Service Request in Service Manager 2012 you can do this with PowerShell. Here is an example.

Before running the PowerShell commands install SMLets and import the module into the PowerShell prompt.

Example

Import-Module SMLets
$Class = Get-SCSMClass -Name System.WorkItem.ServiceRequest$
Get-SCSMObject -Class $Class -filter “Id -eq SR10” | Set-SCSMObject -Property Status -Value InProgress

Other status values that can be used

Closed
Completed
Cancelled
Failed
Submitted
New
Active
Resolved
Pending
Editing

Other classes that can be used

System.workitem.ChangeRequest$
System.workitem.Incident$
System.workitem.Problem$
System.workitem.ReleaseRecord$

0