Send Email to 3rd Party from SCSM Console – PowerShell and Console Task

So recently, I had a customer ask me for the following as their previous incident management system had this functionality.

The customer wanted to be able to send an “Update Email” to a 3rd party from the SCSM Console with automatically placing the reference number into said email. They needed the functionality of sending to any email address. This was a requirement for the type of business they are in.

Please remember that I am by no means a developer. I was thinking of using System Centre Orchestrator, however for this simple requirement, I thought that it might be overkill. I am sure that in time, as the requirements grows and/or changes, System Centre Orchestrator will become a better fit. For this solution, I turned to my friend, PowerShell

I simply wanted to provide a clean interface for the customer to use. I follow a strict rule of KISS (Keep It Straight and Simple). With the PowerShell script, I provide two input fields.

  1. Email address of user for update to go to
  2. Update to be sent to customer.

The screenshot of what the window looks like

All of this was built in PowerShell with some from Sapien PrimalForms Community Edition to assist with the GUI part. The GUI is fully functional and tested. “Send Update” is responsible for sending the update to the specified person and the “Cancel” simply closes the form nicely and allows you to continue as normal.

PowerShell Code Below (SendEmail – Technet Gallery Download)


#region Script Settings
#<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd">
#  <ScriptPackager>
#    <process>powershell.exe</process>
#    <arguments />
#    <extractdir>%TEMP%</extractdir>
#    <files />
#    <usedefaulticon>true</usedefaulticon>
#    <showinsystray>false</showinsystray>
#    <altcreds>false</altcreds>
#    <efs>true</efs>
#    <ntfs>true</ntfs>
#    <local>false</local>
#    <abortonfail>true</abortonfail>
#    <product />
#    <version>1.0.0.1</version>
#    <versionstring />
#    <comments />
#    <company />
#    <includeinterpreter>false</includeinterpreter>
#    <forcecomregistration>false</forcecomregistration>
#    <consolemode>false</consolemode>
#    <EnableChangelog>false</EnableChangelog>
#    <AutoBackup>false</AutoBackup>
#    <snapinforce>false</snapinforce>
#    <snapinshowprogress>false</snapinshowprogress>
#    <snapinautoadd>2</snapinautoadd>
#    <snapinpermanentpath />
#    <cpumode>1</cpumode>
#    <hidepsconsole>false</hidepsconsole>
#  </ScriptPackager>
#</ScriptSettings>
#endregion

 param($ID)
Import-Module 'C:\Program Files\Common Files\SMLets\SMLets.psd1' -Force

 #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0
# Generated On: 2013-11-14 09:08 AM
# Generated By: Fletcher
########################################################################

 #region Import the Assemblies
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
#endregion

 #region Generated Form Objects
$SendUpdateForm = New-Object System.Windows.Forms.Form
$CancelButton = New-Object System.Windows.Forms.Button
$SendUpdateButton = New-Object System.Windows.Forms.Button
$UpdateTextBox = New-Object System.Windows.Forms.TextBox
$UpdateLabel = New-Object System.Windows.Forms.Label
$EmailToTextBox = New-Object System.Windows.Forms.TextBox
$EMailToLabel = New-Object System.Windows.Forms.Label
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
#endregion Generated Form Objects

 #----------------------------------------------
#Generated Event Script Blocks
#----------------------------------------------
#Provide Custom Code for events specified in PrimalForms.
$SendUpdateButton_OnClick=
{
        Write-Host "Send Update"
        $to = $EmailToTextBox.Text
        Write-Host $to
        $from = "Servicedesk@bui.co.za"
        $emailbody = $UpdateTextBox.Text
$subject = @"
Update [ID]
"@
$body = @"
$emailbody
"@
        #$subject = "Update [ID]"
        #Write-Host $subject
        #Write-Host $body
        $smtpserver = "buiexc20.bui.co.za"
        #[string]$body = $UpdateTextBox.Text
        #$testcommand = "Send-MailMessage -To $to -From $from -Subject $messagencontent -Body '$body' -SmtpServer $smtpserver"
        Send-MailMessage -To $to -From $from -Subject $subject -Body $body -SmtpServer $smtpserver
        #Write-Host $testcommand
        $SendUpdateForm.Close()

 }

 $CancelButton_OnClick=
{
#TODO: Place custom script here
$SendUpdateForm.Close()
}

 $OnLoadForm_StateCorrection=
{#Correct the initial state of the form to prevent the .Net maximized form issue
    $SendUpdateForm.WindowState = $InitialFormWindowState
}

 #----------------------------------------------
#region Generated Form Code
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 323
$System_Drawing_Size.Width = 409
$SendUpdateForm.ClientSize = $System_Drawing_Size
$SendUpdateForm.DataBindings.DefaultDataSourceUpdateMode = 0
$SendUpdateForm.Name = "SendUpdateForm"
$SendUpdateForm.Text = "Send Update"

 
 $CancelButton.DataBindings.DefaultDataSourceUpdateMode = 0

 $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 182
$System_Drawing_Point.Y = 264
$CancelButton.Location = $System_Drawing_Point
$CancelButton.Name = "CancelButton"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 124
$CancelButton.Size = $System_Drawing_Size
$CancelButton.TabIndex = 5
$CancelButton.Text = "Cancel"
$CancelButton.UseVisualStyleBackColor = $True
$CancelButton.add_Click($CancelButton_OnClick)

 $SendUpdateForm.Controls.Add($CancelButton)

 
 $SendUpdateButton.DataBindings.DefaultDataSourceUpdateMode = 0

 $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 35
$System_Drawing_Point.Y = 264
$SendUpdateButton.Location = $System_Drawing_Point
$SendUpdateButton.Name = "SendUpdateButton"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 116
$SendUpdateButton.Size = $System_Drawing_Size
$SendUpdateButton.TabIndex = 4
$SendUpdateButton.Text = "Send Update"
$SendUpdateButton.UseVisualStyleBackColor = $True
$SendUpdateButton.add_Click($SendUpdateButton_OnClick)

 $SendUpdateForm.Controls.Add($SendUpdateButton)

 $UpdateTextBox.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 35
$System_Drawing_Point.Y = 135
$UpdateTextBox.Location = $System_Drawing_Point
$UpdateTextBox.Multiline = $True
$UpdateTextBox.Name = "UpdateTextBox"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 103
$System_Drawing_Size.Width = 290
$UpdateTextBox.Size = $System_Drawing_Size
$UpdateTextBox.TabIndex = 3

 $SendUpdateForm.Controls.Add($UpdateTextBox)

 $UpdateLabel.DataBindings.DefaultDataSourceUpdateMode = 0

 $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 35
$System_Drawing_Point.Y = 110
$UpdateLabel.Location = $System_Drawing_Point
$UpdateLabel.Name = "UpdateLabel"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 22
$System_Drawing_Size.Width = 359
$UpdateLabel.Size = $System_Drawing_Size
$UpdateLabel.TabIndex = 2
$UpdateLabel.Text = "Please enter the information to be sent to intended recipient:"

 $SendUpdateForm.Controls.Add($UpdateLabel)

 $EmailToTextBox.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 35
$System_Drawing_Point.Y = 54
$EmailToTextBox.Location = $System_Drawing_Point
$EmailToTextBox.Name = "EmailToTextBox"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 20
$System_Drawing_Size.Width = 290
$EmailToTextBox.Size = $System_Drawing_Size
$EmailToTextBox.TabIndex = 1

 $SendUpdateForm.Controls.Add($EmailToTextBox)

 $EMailToLabel.DataBindings.DefaultDataSourceUpdateMode = 0

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 35
$System_Drawing_Point.Y = 27
$EMailToLabel.Location = $System_Drawing_Point
$EMailToLabel.Name = "EMailToLabel"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 24
$System_Drawing_Size.Width = 439
$EMailToLabel.Size = $System_Drawing_Size
$EMailToLabel.TabIndex = 0
$EMailToLabel.Text = "Please enter the email address of the intended recipient:"

 $SendUpdateForm.Controls.Add($EMailToLabel)

 #endregion Generated Form Code

 #Save the initial state of the form
$InitialFormWindowState = $SendUpdateForm.WindowState
#Init the OnLoad event to correct the initial state of the form
$SendUpdateForm.add_Load($OnLoadForm_StateCorrection)
#Show the Form
$SendUpdateForm.ShowDialog()| Out-Null

 } #End Function

 #Call the Function
GenerateForm

[/code]

Ok, so that is the PowerShell side done. Now, it is time to create the console task. This is a fairly straight forward exercise. There are only a few tips I would like to share. I used a shared folder for the scripts and then mapped the console task to the shared folder. Netivia Consulting has a great idea as well, I will be changing to PowerShell Remoting soon, great idea!!!!!

I have configured the PowerShell script to use a parameter, the ID of the Work Item, this is very easy to configure and ensure that the parameter is passed on. See below.

You will see that I used the “Log in action log when this task is run”. That is where the Write-host in the PowerShell script becomes handy, the write-host lines are added to the Action Log.

Please feel free to use and modify to meet your needs.

(E-Mail me)

Follow me.

Facebook (Personal)

Twitter (Personal & System Centre)

Twitter (System Centre Focused)

Service Request Load Testing for SCSM

I have found a great for load testing SCSM with Incidents. The script uses SMLets to generate Incidents and you can then gauge how your system would handle the load you are planning within your Production Environment.

I will not go into the detail of the script as this blog post does a great job of explaining it. SO this got me to thinking about other Load Testing you could perform. The most common Load Test is with Incidents. However, i decided that another good load test would be Service Requests. What is nice about this load test, is that it uses a Management Pack which I have included in this post. The Management Pack contains a Service Request Template with a Manual Activity added as the first Activity. This will allow you to test Service Requests and well as Activities, which would in turn, test any workflows or runbooks that you have configured.

For my environment, i have additional runbooks which are also triggered when Manual Activities are completed or when Review Activities are completed. So with this Load Test script it also test my runbooks and other workflows.

Remember, to set a different Implementer for the Manual Activity to allow the runbooks or workflows to be triggered off correctly. Remember, no Manual Activity Implementer or if the implementer has no email address, your emails will not be triggered correctly. Below, is a breakdown of the script I am using.

Script

#SMLets is needed for the script to work
Import-Module SMlets

#the number of Service requests to be created
$SRCount = 10

#the delay between attempts
$delay = 10

# Display Start Time
$StartTime = get-date
Write-Host "Started"
Write-Host $StartTime
Write-Host "-------------------`n"
Write-Host "Creating Service Request"
Write-Host "-------------------"
$i =1

while ($i -le $SRCount)
{

#Variable / Class Setup
$srClass = Get-SCSMClass -name System.WorkItem.ServiceRequest$
$srprior = Get-SCSMEnumeration -Name ServiceRequestPriorityEnum.Medium
$srurg = Get-SCSMEnumeration -Name ServiceRequestUrgencyEnum.Medium
$ararea = get-SCSMEnumeration -Name ServiceRequestAreaEnum.Other

#building your own SR Title
$title = "Fletcher Load Testing $i - " + (get-date)

#Service Request Arguements
$srargs = @{
Title = $title;
Urgency = $srurg;
Priority = $srprior;
ID = “SR{0}”;
Area = $ararea;
Description = “Created by Script”
}

#Create Service Request
New-SCSMOBject -Class $srClass -PropertyHashtable $srargs

#Get Projection & Object for Created Service Request
$srTypeProjection = Get-SCSMTypeProjection -name System.WorkItem.ServiceRequestProjection$
$SRProj = Get-scsmobjectprojection -ProjectionName $srTypeProjection.Name -filter “title -eq $title”

#Get Template
$template = Get-SCSMObjectTemplate -DisplayName "Load Test SR Template"

#Set Template
Set-SCSMObjectTemplate -Projection $SRProj -Template $template
$SR = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -filter "Title -eq $title"
$SRName = $SR.name
$SRTitle = $SR.Title
Write-Host $SRName " - " $SRTitle
#$SRName

# Pause before creating next SR
Start-Sleep -s 5

#getting the above created Service Request
$ServiceRequestToUpdate = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -Filter "Id -eq $SRName"

#get the Realted Child Manual Activity
$ChildActivities = (Get-SCSMRelationshipObject -BySource $ServiceRequestToUpdate | ?{$_.RelationshipID -eq "2DA498BE-0485-B2B2-D520-6EBD1698E61B"})

$get the ID Value
$MAIDToUpdate = $ChildActivities.targetobject.values[9].value

#getting the MA Class
$Class = Get-SCSMClass -Name System.WorkItem.Activity.ManualActivity

#getting the "Active" Status
$StatusActive = Get-SCSMEnumeration -name ActivityStatusEnum.Active

$Activity = Get-SCSMObject -Class $Class | ? {$_.ID -eq $MAIDToUpdate}

#setting MA to Active
Set-SCSMObject -SMObject $Activity -Property "Status" -Value $StatusActive

#showing current status
Write-host $MAIDToUpdate " is now " $StatusActive
$i +=1
Start-Sleep -s $delay
}

# Display End Time
Write-Host "_______________________`n"
$EndTime = get-date
Write-Host = "Finished"
Write-Host $EndTime
#End of Script
#

The script can also be downloaded from the Technet Gallery here.

(E-Mail me)

Follow me.

Facebook (Personal)

Twitter (Personal & System Centre)

Twitter (System Centre Focused)

New features–Cireson IT Asset Management

I have previously done a post on CIreson IT Asset Management. However the people at Cireson have been very busy with new features to be added to their ITAM (IT Asset Management) tool.

Cireson Asset Management: New Feature Highlights

After recently releasing the newest version of the Asset Management app for Microsoft System Centre (Features Press Release), this post goes a little more in depth to explain some of the amazing features included in this latest release. Always striving to make life easier and more productive for those who use and implement SCSM, they put a lot of thought into the features clients asked for and updates everyone was clamouring for.

Highlighted below are a few of notable enhancements, including the Cireson full Asset Catalogue, Location to IP Awareness, Contract Management and Reporting.

The full Asset Catalogue found within the Cireson Asset Management app allows users to define standard hardware types, as well as information such as model, manufacturer, and price. With access to a comprehensive yet simple and informative page view with all the relevant information in one place, users can better manage the standardization of asset types no matter what the scale of the organization.

Location to IP Awareness is now also an incredibly exciting feature. This function tracks where hardware assets exist, and also allows for hardware to location awareness based on IP address – information which is provided by System Centre 2012 Configuration Manager. This is a great example of how Cireson works to utilize all System Centre components in order to provide the most insightful and rich experience possible.

Expanding on the extensive Contract Management capabilities of the Asset Management app, the new version boasts the ability to perform full contract management with different types of contracts that relate to various software and hardware assets under management. Support and maintenance contracts, leases, and warranties represent the main areas of contract management. Highly unique to the Cireson app is the ability to manage contract status via a built-in SLA engine, with notifications upon near breach or expiration of a contract’s end date.

In addition, the superior reporting functions of this new version allows for comprehensive reporting based on asset data from the data warehouse and cube reporting engine within Service Manager. These rich out-of-the-box reporting solutions cover contract, hardware asset, license, and software asset reports, amongst others.

image

Other enhanced capabilities of the Cireson Asset Management app now include, app metering data tracking against software asset types to understand installation vs. utilization vs. purchased count, and over 250 brand new features that make the System Centre Service Manager experience better than ever before.

For more information, videos, and overviews relating to Cireson Asset Management for System Centre, visit the app store at www.cireson.com.

(E-Mail me)

Follow me.

Facebook (Personal)

Twitter (Personal & System Centre)

Twitter (System Centre Focused)

Cireson IT Asset Management with Service Manager

Cireson have recently released an new enhancement to the Service Manager console called the Cireson SCSM Asset Management App. This particular application is very easy to install. To install the application into the console, it is simply a case of importing a few management packs and some XML files and DLL files. This is very easy to do and the installation instructions provided by Cireson are very simple and easy to follow as with all Cireson add-ins I have worked with in the past.

In order to get the full benefit from the Cireson SCSM Asset Management App, I would highly recommend that the Configuration Manager Connector be enabled within your environment. However, this is NOT a necessity. Within my environment as I run mine as a Lab, it is not always possible to have all the connectors enabled all the time. I was very easily able to configure my workflows (come with the Cireson SCSM Asset Management App) to work and pull in the required information.

A sample of my workflow configuration is below. The workflows and settings for the Cireson SCSM Asset Management App are found under the Administration Wunderbar and then settings as with all Cireson applications.

There are settings for both Software and Hardware Collections.

Software

image

Hardware

image

A little lower down on the Hardware tab, this is where the Configuration Manager Connector would add a tremendous amount of value as you can reference different  value to be used as a Hardware ID. So, if you had the Configuration Manager Connector enabled, you could reference a Serial Number or Asset Tag. However, it is perfectly feasable to reference Principal name.

image

Under the “Miscellaneous”  tab, is where the logging is configured, which is amazingly helpful for troubleshooting.

image

(E-Mail me)

Follow me.

Facebook (Personal)

Twitter (Personal & System Center)

 Twitter (System Center Focused)

Import CI Items with Cireson Asset Import Tool

With my previous post about importing data, I showed you how to use the built-in CSV connector to do this task and how to create the required Projection Classes. However if you are looking for a quicker more automated to achieve this, enter Cireson and their Asset Import Tool. It takes all the guess work out of the import process and handles the Projection Classes for you.

The installation of the application is easy and requires the copying a DLL file to the Service Manager Installation folder and the import of a Management Pack ( a management Pack Bundle in this case). The instructions provided with the application are very clear and concise.

As usual with the Cireson applications, the settings for the applications can be found and tweaked in the Administration | Settings. This time, this is where the License Key will need to be entered
image

So now, onto the “meat”. Let’s actually use the application and see how it works. The application works pretty much the same way as the CSV Connector. It is classified as a connector, and as such to use it, a new connector would need to be created. Connectors are found under Administration | Connectors

image

If you have any Projection or Combinations classes you would like to use the application does allow the use of this.image

For this demo, I have used the Windows Computer Class, additional information around the Projection classes can be found here, this will allow to see the information (headers) used by the required class. The Windows Computer class has the following information.

Name Type MinLength MaxLength AutoIncrement

PrincipalName

string

0

256

FALSE

DNSName

string

0

256

FALSE

NetbiosComputerName

string

0

256

FALSE

NetbiosDomainName

string

0

256

FALSE

IPAddress

string

0

256

FALSE

NetworkName

string

0

256

FALSE

ActiveDirectoryObjectSid

string

0

256

FALSE

IsVirtualMachine

string

0

256

FALSE

DomainDnsName

string

0

256

FALSE

OrganizationalUnit

string

0

256

FALSE

ForestDnsName

string

0

256

FALSE

ActiveDirectorySite

string

0

256

FALSE

OffsetInMinuteFromGreenwichTime

int (range: [-2147483648, 2147483647])

0

256

FALSE

LastInventoryDate

datetime

0

256

FALSE

ObjectStatus

enum:System.

ConfigItem.ObjectStatusEnum

0

256

FALSE

AssetStatus

enum:System.

ConfigItem.AssetStatusEnum

0

256

FALSE

Notes

richtext

0 4000

FALSE

DisplayName

string

0

256

FALSE

So, for this, I will bulk import a few computers with only a few simple parameters.

I am simply adding two machines

 image

The Asset Import Tool also allows you to test your configuration first.

image

Now we can map the Headers to the Projections, you will see I kept them the same, however if you are getting a file from the IT Department or any other department, this step here allows to map these correctly.image

Next, you can set your frequency, allowing you to automate the import. I have configured mine to run Every Hour.

image

Then you can create the connector.

Final Connector completed.

image

Now lets run it!!!!

image

Since we enabled the option to “Test”, the results were written to a log file allowing us to test before running in a production environment.

image

All looks good, let’s run it to bring in the data. A simple change needs to be made. We just need to remove a checkbox.

image

Ok, change made. let’s import the data. So now, let’s re-run the import process.The Connector has now re-run, now we can check the data. This time without the testing.

image

Now, we can see the new imported data. We can check here under Configuration Items | Computers | All Windows Computers

image

And there we have it, importing nice and easy.

(E-Mail me)

Follow me.

Facebook (Personal)

Twitter (Personal & System Center)

 Twitter (System Center Focused)

Importing data into Service Manager–CSV import and XML

So, just recently I was asked by a customer to import data from an “old” SCSM system. The customer is moving to new hardware within the organization and is using this opportunity to clean up Service Manager and re-import only clean data.

So, the challenge is the following.

The customer wants to import Change Requests from the “old” Service Manager to the “new” Service Manager. Ok, so after some research and confirmation, it is NOT possible to simply move data from one Service Manager installation to another. I decided the best way to handle this would be to import the data using a CSV file. As a start I used the following links

http://www.netiviaconsulting.com/2012/05/04/importing-work-items-in-bulk-into-scsm2012-via-csv-import-connector/

http://blogs.technet.com/b/servicemanager/archive/2009/05/26/using-the-csv-import-feature.aspx

So, now onto the “meat” of the work, it is entirely up to you what data you would like to import.

Below is a sample of my XML file. It caters for the basic information on the Change Request form and for my customers needs, it caters for SIX Manual Activities and ONE Review Activity. I will break this down into smaller pieces in a moment.

The Appendix “A” here is key to the import process.

XML Code

<CSVImportFormat>
<Projection Type="System.WorkItem.ChangeRequestProjection">
<Seed>
<Class Type="System.WorkItem.ChangeRequest">
<Property ID="Id"/>
<Property ID="Notes"/>
<Property ID="Title"/>
<Property ID="Description"/>
<Property ID="ContactMethod"/>
<Property ID="Priority"/>
<Property ID="Impact"/>
<Property ID="Risk"/>
<Property ID="Reason"/>
</Class>
</Seed>
<Component Alias="CreatedBy">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ReviewActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>
</Projection>
</CSVImportFormat>
<code>


Okay, so now time to break it down into smaller easier to manage bits.

Base Change Request Projection Class. This is the framework for Change Request and this example included the “Created By” extension. All the property id’s can be found in the appendix here. Please note that the example below does NOT include the “Projection” closing XML Brace as this is included further down with the original coding.

XML Code

</pre>
<code></code>

<Projection Type="System.WorkItem.ChangeRequestProjection">
<Seed>
<Class Type="System.WorkItem.ChangeRequest">
<Property ID="Id"/>
<Property ID="Notes"/>
<Property ID="Title"/>
<Property ID="Description"/>
<Property ID="ContactMethod"/>
<Property ID="Priority"/>
<Property ID="Impact"/>
<Property ID="Risk"/>
<Property ID="Reason"/>
</Class>
</Seed>
<Component Alias="CreatedBy">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>

<code>

So, now after this I have simply “bolted” on as many Manual Activities as I needed for my customer. In this case, it is SEVEN. I have a sample of the XML code below which can be simply copied and pasted as many times as needed. Please note that the example below does NOT include the “Projection” closing XML Brace as this is included further down with the original coding.

XML Code

</pre>
<code></code>

<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ManualActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>

<code>

And now I needed to add a Review Activity, again this is just the simple information needed.

XML Code

</pre>
<code></code>

<Component Alias="Activity">
<Seed>
<Class Type="System.WorkItem.Activity.ReviewActivity">
<Property ID="Id"/>
<Property ID="SequenceId"/>
<Property ID="Title"/>
</Class>
</Seed>
<Component Alias="ActivityAssignedTo">
<Seed>
<Class Type="System.Domain.User">
<Property ID="Domain"/>
<Property ID="UserName"/>
</Class>
</Seed>
</Component>
</Component>

<code>

So, all the components together created the XML file for the Projection that I needed.

Ok, so this is ONE piece of the puzzle. In order for the CSV import to work within Service Manager, you need a CSV file as well. Building the CSV file is actually quite easy. Simple use all

   <Property ID =”..”> <code>


tags as CSV headers.

Populate the file as needed. Now lets import the file. By the way, I have noticed that if the file is created in Excel (2013 at least) and saved a .csv, Excle uses “;” and NOT “,”. So simple open the application in Notepad and do a search and replace.

Sample file (CSV)

Headers are based on Property values within the XML File.

CR{0},CR notes,CR Title 1,CR Description 1,CR Contact Method,ChangePriorityEnum.Medium,ChangeImpactEnum.Standard,ChangeRiskEnum.Medium,CR Reason 1,FK,fletcherk,MA{0},0,MA Title 1,fk,fletcherk,MA{0},1,MA Title 2,fk,fletcherk,MA{0},2,MA Title 3,fk,fletcherk,MA{0},3,MA Title 4,fk,fletcherk,MA{0},4,MA Title 5,fk,fletcherk,MA{0},5,MA Title 6,fk,fletcherk,MA{0},6,MA Title 7,fk,fletcherk,RA{0},7,RA Title 1,fk,fletcherk

Please note that the Sequence ID can be changed to sort you needs. Remember that the Sequence Number will start at 0. The MA is the prefix for the Manual Activities and the RA is the prefix for Review Activities, please adjust as needed.

Also, the {0} ensures id are incremented correctly.

image pl

Select XML file and CSV file

image

image

image

image

You can import as many Change Requests as you wish using this method.

(E-Mail me)

image_thumb_thumb_thumb_thumb_thumb

Follow me.

facebook-small322252222 Facebook (Personal)

twitter-small322252222Twitter (Personal & System Center)

scsmlogo25232 Twitter (System Center Focused)

MCC11_Logo_Horizontal_2-color_thumb_

Cireson My Active Work Items

So, Cireson has been hard at work to fill a few gaps present within the Service Manager space. Cireson has created an application called My Active Work Items to bring all information assigned to your user token in one place. For Service Manager 2010, you could create the Work Items assigned to Me view. This was a good start for SCSM 2010 and this continues to work with SCSM 2012. However, with SCSM 2012, there are a few shortcomings of this view. The Work Items assigned to Me, it only shows some very limited information and this view cannot be edited.

image

Please make no error, this view is helpful and can provide the required information. It is still context driven on the right hand pane.

But now, enter My Active Work Items. Below is a screenshot to give you an idea of how it looks. I will then look at individual aspects.

image

If you have multiple work items of the Same type, For example, Incidents, they will be grouped together. In the Screenshot below, I have created 2 incidents to demonstrate this.

image

the pane below the “My Active Work Items” provides all information needed about the highlighted work item at a glance.

SNAGHTML46c3381

All the other features associated to the Highlighted work item are available as a right click context item. I will show a few examples below.

Incident

SNAGHTML4742dcd

Review Activity

SNAGHTML47bf7d2

Problem

SNAGHTML48cb49c

Change Request

SNAGHTML4a035f5

Also note the “My Active Work Items” context menu which allows easy to the creation of any type of Work Item.

image

The installation and configuration of My Active Work Items is very simple and quick. The installation instructions provided are clear and concise and the settings, found under Administration –> Settings can be easily tweaked and changed to suit your needs.

If you have looked at my previous Cireson Group Assign post, you will see that the AD Groups leveraged within that Service Manager application can be leveraged again.

SNAGHTML4b3dd06

All in all, Cireson have a great application with My Active Work Items and I would highly recommend it for any Service Manager 2012 installation. It also work with Service Manager 2012 Service Pack 1.

(E-Mail me)

image_thumb_thumb_thumb_thumb_thumb

Follow me.

facebook-small322252222 Facebook (Personal)

twitter-small322252222Twitter (Personal & System Center)

scsmlogo25232 Twitter (System Center Focused)

MCC11_Logo_Horizontal_2-color_thumb_

Cireson Analyst Web Console

I have always heard complaints from some of the analysts in my company about having to install the Service Manager Console on their machines and then complaining about having to learn a new application.

So, I went searching around and found a great application called Cireson SCSM Web Console, this allows analysts to update Incidents via a newly designed web portal for Analysts. Since the console is designed in HTML5, the web console is browser agnostic. This face also helps some companies to adopt this as it allows analysts to use all types of devices to update incidents.

The guide provided to install the application is Comprehensive and easy to follow. Just make sure you do all the steps. I have added some screenshots of errors I got along the way, trying to “jump the gun” and see the new Web Console in action.

“Issues and Errors” I ran into, all of which are easily fixed.

Server error in ‘/’ Application

image

This error is pretty much self-explanatory, I tried to open the console before the Cireson Management Pack had been imported. A simple fix, import the Management Pack.

image

Again, this looks intimidating. This is very easy to fix if you look at error. When you are going through the installation guide, it is very easy to miss a step. Like this, when configuring the web.config file with Active Directory Connector information, it is very easy to find the space for the DN Name of your domain. When the above happens, it is simple a case of not adding the full DN for a DOMAIN CONTROLLER.

But now, onto the console in action. Just one side note, for now the Cireson SCSM Web Console handles only incidents, I have heard that plans are in progress for the Cireson SCSM Web Console to be extended to include Service Requests and potentially Problems, WOW!!!!!!

The Cireson SCSM Web Console is really easy to navigate and very easy to understand, anything you can do in the actual console, you can do on the Cireson SCSM Web Console. So, if you make the Cireson SCSM Web Console publically available, your Analysts can update from anywhere with any device as the Web Console is NOT dependent on Microsoft Silverlight.

As you can see below, the Web Console is very nicely put together and gives you all the information you need at a quick glance.

image

You can click an incident to open it and you will be presented with some detailed information regarding the incident as can be seen below. You can also “Edit Incident” from the Web Console to update it.

image

From the top Level Tabs, you can see you access all the information you could regarding Incidents

image

Below are screenshots of each “Section” from the Top Level Menu”

Incidents can also be LOGGED from the Web Console, displaying all information from your SCSM Implementation

image

The “My Team’s Incidents” leverages the groups and information provided during the installation of the Web Console and provides a consolidated view of the Incidents assigned to the “Support Group” to which the currently logged on user is a member and this works very nicely with Cireson SCSM Group Assign

image

The “All My Incidents” View provide a view of all incidents assigned to the currently “logged on” user.

image

The “All Incidents” view provides an overview for all incidents within your Service Manager environment. By default, only active incidents are shown, you can select the checkbox to show resolved incidents.

image

The “Search Incidents” views allows you to search via a number of different fields, making it really easy to find any incidents you are looking for.

image

The “Configuration Items” view is the representation of the CI Items within the organization on the Web Console.

image

The Cireson SCSM Web Console is a great addition to your Service Manager environment. It allows incidents to be updated quickly and easily from any device. I would highly recommend it.

(E-Mail me)

image_thumb_thumb_thumb

Follow me.

facebook-small322252222 Facebook (Personal)

twitter-small322252222Twitter (Personal & System Center)

scsmlogo252 Twitter (System Center Focused)

MCC11_Logo_Horizontal_2-color_thumb_

AssignedTo and AffectedUser with Powershell – Service Manager

So recently I got an e-mail to my newly setup e-mail address, for just this reason Smile,  from someone asking if I knew a way to do the following.

image_thumb

“I was trying to find a way to find all Incidents related to a specific person (assigned  to or affected user) using PowerShell”

So, I decided the best to answer this with a blog post as maybe there are other people out there asking the same question. This is a quick solution using

get-scsmincident

At this moment in time, this will address ONLY incidents. I will work on some code using

get-scsmobject

to reference work items. I will add the pieces of code as I go and explain the code.

First lets start by importing the required module, SMLets can be downloaded here

import-module smlets

I am running these commands on a computer that is NOT the Management Server. So I need to specify a computer name when I am running these commands. So, in the next line I create a

$computername

variable to make my life easier. If you are running these commands on the Management Server, you can remove the

-computername $computername

piece of code. Below is how I created this, please use the name of your Management Server

$computername = “name of your Management Server"

Ok, so now lets get all active incidents. I will run a PowerShell Command to get all Incidents that are NOT EQUAL to “Resolved” or “Closed”. This allows us to cover all other incident statuses you may have created. Notice the –ne operator.

$allincidents = Get-SCSMIncident -ComputerName $computername | Where-Object {$_.Status -ne "resolved" -and $_.status -ne "closed"}

So now we have all the incidents in an object, now what????

Personally, I choose to sort the information, enter

Sort-Object

with Powershell. So, to elaborate a little further you can use

get-member

orGM” for short and “pipe” your variable to “GM” / Get-member

$allincidents | gm 

OR

$allincidents | get-member 

image

Now you have a list of all the properties you can use. You can also go deeper into the ‘Members’ of the object. You can do the following as well

$allincidents.affecteduser | gm 

It is simply a case of playing around and digging a little bit.

So now back to the

Sort-Object

. I wanted to sort by AssignedTo user, this can be easily changed by changing the

-Property 

field of the

sort-object 

I also chose for this example to display the information in a useful grid. This too can be changed as needed.

$allincidents | Sort-Object -Property Assignedto | Select-Object -Property ID, Displayname, AffectedUser, Assignedto | Out-GridView

You will get some results like the below.

image

You can also limit the results by “Assigned To” user like such using either

-like 

or

-eq 

operators. Examples below

-like operator. The example is finding all calls assigned to a user where the name is like “Kok*”. This time without the “out-gridview”

$allincidents | Where-Object {$_.assignedto.displayname -like "kok*"} 

image

-eq operator. This example finds all incidents assigned to a user with a specific name. In my example I am using “Desmond Hilton”

$allincidents | Where-Object {$_.assignedto.displayname -eq "Desmond Hilton"}

image

The PowerShell code can be easily adapted to meet the requirements for the “Affected User”. We simply change the value to use with the current object like such. I use

$Get-member

on “Affecteduser”

$allincidents.affecteduser|gm

. Again you can use the

-like 

or

-eq 

operators

$allincidents | Where-Object {$_.assignedto.displayname -like "kok*"} 

-like operator. In this example I am using the Name “like” Roland

$allincidents | Where-Object {$_.affecteduser.DisplayName -like "Roland*"}

image

-eq operator. In this example I am using the “Affected User” name of “Andre Botes”

$allincidents | Where-Object {$_.affecteduser.DisplayName -eq "andre Botes"}

image

This should help you to make more in-depth queries and enjoy using PowerShell and SMLets to get valuable information from System Center Service Manager.

I have also setup an new e-mail address to help with Service Manger queries. you can e-mail me at systemcenterguyza ”at” live ”dot” com  (systemcenterguyza@live.com) and I will assist as much as I can.

I have also setup a new Twitter account to focus the Information around the System Center Suite.

scsmlogo2

image_thumb

Follow me.

facebook-small322252222twitter-small322252222

MCC11_Logo_Horizontal_2-color_thumb_

How do I “learn” System Center Service Manager 2012?

So, I recently made a very simple comment on Facebook. This lead to some interesting comment and questions being raised about Service Manager about “Training for Service Desk” staff” in particular. At this moment in time, there is no “Service Desk Staff” training that I am aware of. So I decided to try and address this as best I could.

I have decided to consolidate some of the more important components and concepts of Service Manager and place them in one spot. I will be looking at all facets of Service Manager and trying to give ideas and concepts aimed at Administrators, Analysts and End-Users and provide some tools that I think are invaluable to modifying and making Service Manager more focused around your business.

For a complete glossary of terms used in Service Manager, click here

Training

For Service Desk Staff, I would start with the Operations Guide, this contains all aspects of Incident, Problem, Change and Service Requests as well as some other aspects including reporting which should be used by an Analyst. Here are some nice videos

Tweaking for your business

So now, onto the more “nitty-gritty” of making Service Manger yours and making it suit your business and understanding the concepts of Service Manager. I would highly recommend the Microsoft Virtual Academy for all studying requirements. This System Center 2012: Orchestrator & Service Manager course is aimed specifically at Service Manager, however this Introduction to Systems Management & Service Delivery would also be worth a look.

Now that we should be a little more comfortable with the concepts of Service Manager, the single best resource for Service Manager that I can think of, and it is run by Microsoft Staff is the System Center: Service Manager Engineering Blog. You will notice that a lot of the entries I reference will be from the blog above. I have listed these below.

System Center 2012 – Service Manager 101: Focus on Incident Management – Very nice blog post

Implementing Sample Helpdesk Scenario in Incident Management – 1

Implementing Sample Helpdesk Scenario in Incident Management – 2

Routing Incidents Submitted by Email

Configuration Items

Another really nice and often overlooked component of Service Manager is the CMDB, which allows all your Configuration Items to be stored in a Central Location. There are also a lot of built-in connectors which allow Service Manager to “talk”/gather information from a lot of Microsoft sources. These are listed below.

Connectors to Import Data – includes

Active Directory – Used to create your users within your Domains as Configuration Items, used primarily for “Affected User” and “Assigned To” users

Configuration Manager – Used to import configuration Items from SCCM relating to Computers and Software Inventory and other data you have configured within your SCCM environment

Operations Manager – this has two connectors.  1 for Configuration Items and 1 for Alerts.

 Orchestrator – Used to connect to the Runbook Service to allow for Runbooks to be referenced within Service Manager for the automation of tasks.

Virtual Machine Manager – Used to import Configuration Items from Virtual Machine Manager including Virtual Machine information including Service Templates, Location, host nodes and the like….

CSV File – Can be used to import information from a CSV file and creating Configuration Items.

Some links below about creating Custom CI’s

Creating Custom Configuration Item Classes Using the Service Manager Authoring Tool

Creating custom classes in System Center Service Manager 2010

How to create a new CI class and a new form

Creating a New Configuration Item Class in System Center Service Manager – YouTube

Tools and “Essential” Management Packs

So, now I move onto a section very dear to my heart. This is where you can modify the Console and/or workflows to meet your requirements. I will suggest some “add-on’s” that I use in all environments, whether they are Customer Facing, Internal or Test/Lab environments. I will supply a link to the Management Pack/Tool/Workflow and a short description of what they do and why I insist on using them and some potential “gotchas”

Lots of additional tools and/or management packs can be found on Technet Gallery, I have narrowed down the link to be Service Manager specific

Cireson Auto Close App – This is a great which allows for the easy closing of Work Items. I have blogged about this previously.

Advanced View Editor – great for modifying views within Service Manager, also allows you to edit XML for Management Packs (specifically “criteria”) on the fly. Also allows you to change the generic Display for Affected User and Assigned To user to a more descriptive value. More of his tools can be found here. Follow him on twitter here.

Notification workflow on Work Item assignments – This is great to automate the notification of the assigned to User with Incidents and Changes, this is great. I have also modified this to work with Service Requests and I have uploaded it to Technet Gallery.

Notify Analyst When End User updates Incident – This is actually a subscription that is setup. It can also be easily modified to work the other way round and notify the End User when the Analyst updates the incidents.

Mail Notification: Remind Reviewers – This is particularly helpful when it comes to Change Management, as a lot of Review Activities can be sent out and most times the e-mails are ignored. So this Management Pack automates this task of sending out reminders. AndersAsp blog can be found here

Exchange Connector – This is a great for Analysts to use to update calls and use your Exchange Environment to your advantage for updating work items, I have blogged about this previously. Please note: Any comment added via the Exchange Connector is treated as an “Analyst Comment”and marks the comment as “Private”. Please keep this is mind for workflows.

Another great source of information is the System Center – Service Manager – Technet Forums

I have also setup an new e-mail address to help with Service Manger queries. you can e-mail me at systemcenterguyza ”at” live ”dot” com  (systemcenterguyza@live.com) and I will assist as much as I can.

image

Follow me.

facebook-small322252222 twitter-small322252222

MCC11_Logo_Horizontal_2-color_thumb_