• Glen (Xapity)

Xapity PowerShell Activity - Features

We think that Xapity PowerShell Activity can change the way you administer SCSM. It can reduce the

Xapity PowerShell Activity for SCSM - Features

number of Orchestrator ( SCORCH ) runbooks and help simplify your environment.

Xapity PowerShell Activity runs on the Service Manager workflow server and can leverage any PowerShell module that is installed on the workflow server. The most obvious one to use is SMLets, but you could load Active Directory, Exchange or any of the other PowerShell modules.

Using one or more Xapity PowerShell Activities on a Change, Release or Service Request and you can just about do anything you want. It can makes changes within Service Manager using SMLets to add reviewers, copy descriptions and even create new activities dynamically based on the data entered in the parent work item. With the appropriate modules loaded on the server you can make changes outside of Service Manger to AD, Exchange, SharePoint or the file system. It is only limited by your imagination and ability to write the PowerShell script.

Here are some of the major features that we think are useful (not in any particular order):

Central Library for scripts

  • Stores all PowerShell scripts in one location. Only SCSM full administrators can create and edit scripts.

  • Each time the PowerShell Activity goes In Progress it calls to the Library to get the current script. This means that you only need to edit the script in the library once and wherever that script has been used, on activities or in templates, it will now use the latest script.

  • Scripts can be enabled or disabled. This allows a script to be in draft and not available to PowerShell activities until you are ready. If an enabled script is set to disabled, then any PowerShell activity that uses the script will fail.

Central Script Library - Xapity PowerShell Activity for SCSM

Run As and PS Credentials

  • PowerShell scripts will run under the SCSM workflow account by default. But we give you two other options:

  • Run As allows you to enter an alternative user credential and store it in encrypted format with the script in the script library. When this script is added to a PowerShell activity it will use the Run As credentials instead of the SCSM workflow. The Activity Implementer does not need the password or know the account used, they just choose the script from the library and the SCSM Administrator has already configured the details.

  • PS Credentials allows the script to use the PS Credential option that many commands have built in them. The SCSM Administrator adds the PS Credential to the script in the library and then use the -Credential option on a command within a script. For each script there can only be one PS Credential. If you need two PS Credentials, you will need to split your script into two separate scripts or use the Run As and PS Credentials together for two separate identities.

PS Credentials and Run As Accounts - Xapity PowerShell Activity for SCSM

Error Handling

  • By default, when a Script has a terminating error the PowerShell Activity will be marked as Failed and this will stop the workflow. However, you can override this by enabling the On error Continue Workflow option.

  • On Error Continue Workflow – allows the parent Work item workflow to continue even if the script has a terminating error. Note this will mark the PowerShell Activity as Completed even though it had a terminating error when running.

Email Notifications on Error

  • When enabled, an email will be sent using a specified notification template when a terminating error has occurred. The email is sent even if the 'Continue on Error' option has been enabled.

Send Email on Error using Templates  - Xapity PowerShell Activity for SCSM

Activity can display PowerShell Script Output

  • Any output (including errors) generated by the script will be displayed on the PowerShell Activity Output Tab

  • This captures anything that you would normally see in a PowerShell window - Write-host output, red errors etc. and is extremely helpful when troubleshooting errors in the script.

Example: Successful Script Output:

Successful PowerShell Script Output - Xapity PowerShell Activity for SCSM

Example: Error Script Output:

PowerShell Script Error Output - Xapity PowerShell Activity for SCSM

Run in a Separate Process

  • The Service Manager SDK opens a session when running a PowerShell script and this session stays open for a period of time. When the next script runs, it will use an existing session, if available. Usually this will not cause any issues, but if it does, then use this feature to ensure that the script will run in a separate session and that scripts do not carry over any unexpected variables and results.

Run in a Separate Process - Xapity PowerShell Activity for SCSM

Built-in Variables

The PowerShell Activity includes the following variables that can be used in scripts:

  • $ActivityID – the PowerShell Activity ID e.g. AC440

  • $ActivityGUID – the PowerShell Activity GUID e.g. 32737e7b-4e59-2d42-ddf1-0c7be6477a3d

  • $ParentID – the ID from the parent Change, Release or Service Release e.g. SR567

  • $ParentGUID – the GUID from the parent Change, Release or Service Release e.g. cb88eebd-b027-d377-ea17-097174834b28

  • $RunAsCredential – can be used with PowerShell commands that support the PS Credential option.

Run from a custom Workflow

  • Xapity PowerShell supports Service Manger Authoring Tool Workflows and allows a workflow to use the scripts contained in the Library. See the blog post for the step by step instructions.

  • By creating a workflow and linking it to a script in the library, it makes updating and maintaining the workflow a lot easier. Just update the script in the library and now the workflow has also been updated.

Supports all Service Manager Languages

  • Xapity PowerShell Activity supports all Service Manager languages.

  • You also have the ability to edit the translations and import your own translations in Xapity PowerShell. This allows you to brand the tasks, dialogue boxes and prompts in ways that are meaningful to your business needs.

Example from Script library in German Language: Note the Script is still in English as that was the language used.

All SCSM Languages - Xapity PowerShell Activity for SCSM

Example PowerShell Scripts We have posted a number of example scripts that can be used to get started with the Xapity PowerShell Activities:

See all PowerShell Scripting Examples here: http://www.xapity.com/blog/category/PowerShell


Xapity PowerShell Activity for SCSM - Features

Xapity PowerShell Activity

The Xapity PowerShell Activity is an 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

#PowerShell #SCSM #PowerShellActivity #Apps

80 views0 comments

Recent Posts

See All