Let’s say you are doing some fancy stuff like manually crafting some notifications like this blog post:
http://blogs.technet.com/servicemanager/archive/2009/12/15/custom-notification-workflow-on-inci...
…and you want to be able to send the notification to a specific user (or group) using the portion of the rule configuration XML that looks like this:
<WorkflowArrayParameter Name=" PrimaryUserList " Type=" string ">
<Item> d37d441f-20e2-134b-1fea-2f708188bfb2 </Item>
</WorkflowArrayParameter>
You need to know the GUID of the user ID to put in the <Item> element.
How do you get that? Well – use SMLets of course!
Here is an easy example:
Get-SCSMObject –Class (Get-SCSMClass –Name System.Domain.User) –Filter “UserName -eq twright” | Format-Table ID, DisplayName
Looks like this:
Then you can just copy the GUID right out of the PowerShell window there!
Update : 12/7/2011
If you try to do this for a work item object it won’t behave the same way though because there is a System.WorkItem.Id property that is inherited to all work item classes. In order to get the GUID ID in that case you need to do a special trick.
You can use either the Get_ID() method or the PSObject… approach to get at the underlying object and get the GUID of it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.