SCSM PowerShell Links
We have been working with PowerShell recently and wanted to gather the PowerShell links and resources that were specific to Microsoft Service Manager. These are in no particular order and hopefully you will find them useful.
If we have missed any you think would benefit the SCSM community, drop us an email firstname.lastname@example.org
Microsoft Service Manager Cmdlets
Microsoft provide a large number of PowerShell Cmdlets for SCSM. Here you will find a full reference list of the Out of the Box PowerShell scripts.
The SMLets are extremely useful and will let you make use of many extra commands in your scripts. Many of the scripts listed here will require the SMLets.
These posts by Travis Wright on the Official System Center Service Manager Blog have examples and details and step-by-steps on using the SMLets.
A list of our posts related to PowerShell:
PowerShell for SCSM: Download Attachments
A System Engineers Blog
Thomas Strömberg’s very useful blog on SCSM and automation.
1. Service Manager PowerShell examples
Add an analyst comment to an Incident
Add an end user comment to Incident
Add an end user comment to Service Request
Apply a template to an incident
Upload an attachment to a service request
Set affected service when creating an incident
Populate AD-user class with email-address from Active Directory (AD)
Another great blog on Powershell by MVP Francois-Xavier Cat. It has some nice SCSM specific examples: 1. My first steps PowerShell / SCSM
Get the Service Requests objects
Get the Service Requests created in the last 2 days
Get the Service Requests created in the last 2 days Status : In Progress
Get related object(s) of the Service Request
Get relationship object(s) of the Service Request
Get relationship object(s) TargetObject and RelationshipID of the Service Request
Get relationship object(s) and filter on Active Directory objects
Finding the real class of an object
Adding a property Class
3. Change the Status of a Manual Activity or a Service Request PowerShell / SCSM 4. Get the Work Item parent of an Activity PowerShell / SCSM 5. Get Manual Activities Completed in the last month PowerShell / SCSM 6. Get Manual Activities Completed per Assigned user in the last month PowerShell / SCSM 7. Finding the GUID of an object PowerShell / SCSM
Getting the GUID for a WorkItem
Getting the GUID for other objects
Catapult Systems Blog: SCSM PowerShell: Series Overview
http://blogs.catapultsystems.com/mdowst/archive/2015/06/19/scsm-powershell-series-overview/ Matthew Dowst at Catapult Systems has written a great series of blogs on SCSM PowerShell: 1. Getting Started with Service Manager PowerShell 2. Get Work Item Information
Finding the Class
Querying Work Items
Formatting Your Output
Saving Your Results
Filtering Your Results
Working with Results
Create Work Items
Work Item class’s prefix settings
Creating PowerShell Workflows
Putting it all Together Creating PowerShell Workflows
General Service Manager blog. They have the following PowerShell posts: 1. Manage Attachments from Service Get-FileAttachments.ps1 – Retrieve file 2. SMLets – Enum and wildcards 3. TypeProjections SMLets – Performance Tip 4. Affected User SMTP Address
System Center Central
A general System Center blog site had the following posts: 1. Day 18 - PowerShell and System Center Service Manager 2012––Getting Started
Create a new incident in SCSM and writes out the Incident ID
2. Day 18 - PowerShell and System Center Service Manager 2012–SMLets 3. Day 78 - Using PowerShell to create a Service Request using a Template 4. SCSM 2012 QuickTip: Retrieving the Assigned User Info for a Work Item via PowerShell
Another great blog series on Service Manager with some nice scripts that can be downloaded: 1. How to change URLs in SCSM 2012 notifications templates using PowerShell 2. Add Comment about Review Decision 3. About the type of the parameter of the Powershell script in the Service Manager Authoring Tool 4. How to acknowledge First Response Time for Service Requests in Microsoft System Center 2012 Service Manager 5. How to completely remove Exchange Connector’s instances in Service Manager 2012 6. How to get InstanceID to download a file attachment from a SCSM 2012 portal 7. Getting any SCSM entity by Guid 8. Creating a sealed management pack with SCSM outriggers using PowerShell
System Center Me
A System Center Blog by Jonathan Andersson. 1. Create Request Offering with PowerShell in Service Manager 2012 2. Tiny script that shows all SCSM 2012 Tier Queues that are empty 3. Get the SCSM View ElementID from MP with PowerShell 4. Web page displaying amount of SCSM Incidents, Service Requests and Change Requests 5. Change status in Service Manager 2012 with PowerShell 6. Create Management Pack and Template in Service Manager with PowerShell
Has started an SCSM Script Repository https://github.com/sjohner/SCSM-ScriptRepository
Xapity PowerShell Activity
The Xapity PowerShell Activity is a new Activity for SCSM that enables PowerShell scripts to be run in SCSM workflows. Automate more of your processes directly in SCSM.
Scripts are stored and updated from a central script repository. The scripts execution output can be viewed and if a failure occurs, an Email Notification can be sent.
Xapity - Innovative Software for SCSM - Discover our Products