SCSM Templates – Get all Workitems with a specific Title in an Activity

I wanted to find out, which Templates use a manual activity with a specific Value in the Title. This can also be used for other properties.

$findMAmatchTitle = ‘IMPORTANT’
import-module smlets
## get all Workitems at the highest level
get-scsmobjecttemplate | %{$so= $_ ; $_.ObjectCollection} | % {$_.Propertycollection} | ? { $_.mixedvalue -match $findMAmatchTitle } | %{$so}
## get all Activities - be aware no cascades like activities in parallel activities.
get-scsmobjecttemplate | %{$_.ObjectCollection} | % {$_.Propertycollection} | ? { $_.mixedvalue -match $findMAmatchTitle } | %{$_}

If you have activities in activities (eg parallel) you won’t get the second level.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s