Read this bog post first:
In SCSM 2010 we had an Active X control that was used to look up the local computer name that the user was running the portal on. If a computer record existed for that computer it would be added to the submitted incident as an affected computer. That was good and bad. It was good because it gave the analyst working on the incident some context about what computer could be having the problem. The user didn’t necessarily need to know the name of the computer. But it was also not ideal because it required an Active X installation on the client. It also isnt necessarily always true that the computer the user is submitting an incident from is the computer that is having the problem. It also wasn’t possible to select any other computer as the affected computer.
So, in SCSM 2012 the request offering wizard makes things a little more flexible. You can use the Query Results prompt type to present the user with a list of objects to choose from (and it could be multiple). One of the more common things you will want users to provide when making a request from the service catalog is to choose a computer. Oftentimes you want this to be a computer that is related to them somehow in the CMDB – typically either through the Custodian or the Primary User relationship. The Primary User relationship is automatically populated from SCCM based on the logon history of the computer so this is a good way to determine which computers a user frequently uses. In this blog post I’ll show you how to allow the user to select from only those computers for which he is the Primary Owner.
For this example, I have created a ‘PC Recycle’ request offering.
You can see that there are only two computers shown in the list even though in my test environment I have quite a few more than that:
Those two computers show up because they are the only two for which I am the primary user:
Let’s take a look at how I configured the request offering to limit the list of computers to just those for which I am the primary user.
Here’s the General information:
Here is where I create the user prompt for the user to choose a computer. Notice it is a Query Results prompt type.
On the Configure Prompts page, I select the computer prompt and click the Configure button…
…. which brings up this dialog:
In the Select Class tab I choose ‘Combination Classes’ from the drop down because we are going to use a “type projection”. Using a type projection allows us to specify query criteria which spans over relationship types. For example – ‘all computers where the related primary user’s username = twright’.
I then chose the Computer (Advanced) combination class (aka type projection).
On the Configure Criteria tab I select the Primary User relationship on the left and then check the ‘User Name’ checkbox on the right and click the Add Constraint button.
Now, this is where the magic happens! First select ‘Equals’ from the operator drop down. Then pull down the Set Token menu and select the ‘Token: Portal User Name’ option.
The result will look like this:
The effect of this is that whatever the logged in user’s user name is for the user that is accessing the portal will be passed in at run time to this criteria. The result is that only those computer which are related to the user over the Primary User relationship will be displayed.
On the Display Columns tab I choose which columns I want to display:
On the Options tab I choose to relate the selected computer as an affected configuration item to the service request that will be submitted.
Configuring the rest of the request offering is just standard stuff so I won’t go into that here.
The result of someone submitting a service request like this is:
You could use this same approach for displaying other types of objects that are related to the user logging into the service catalog such as:
pretty cool - thanks for sharing that!
Peter Forster, Microsoft MVP 2002-2011
Is SCCM 2012 required for the "Primary User" field to be populated automatically?
I am currently running SCCM 2007 and that filed is not populated.
Travis thanks for publishing the article
We are attempting to achieve a similar output but instead of returning device affinity we want to return usernames based on an AD attriubute
We are unable to map Request Offerings input field setup as a query to Automation Runbook input field
Is this possible as it is not shown in your blog
How is the mapping configured in the request offering
I have trouble mapping the correct input to any property of the request form.
the inputfield is not shown, only the usertoken
The tutorial works very well, thank you!
Can this be set to ALWAYS fill the user's primary computer(s)?
Knowing my clients, unless it's a required field to submit, 95% will skip that step.
I can't make it required, in the event someone doesn't have a primary computer assigned.
@Frosty - sorry, no there is no way to default select the objects or force selection right now.
I tested this in our Development installation of SCSM 2012, and we have setup a connector to our production installation of SCCM 2007.
I ran it on My ID which I had several test IR tickets where I had manualy added my computer to the affected configuration items. Because of this the Query worked. Unfortunately I found that on other ID's it didn't work because the primary user field wasn't updated.
In our SCCM there is a Query by last login user that shows results of computer names, that we use in the Helpdesk. Is there a way to save those results when run, and then import that field through the SCCM to SCSM connector? The only available option for import I see listed currently is the Computer objects.
What would you say is the best way to populat this field? SCCM? AD? And How...
@RYSr - If you have asset intelligence enabled in SCCM this information should be populated by the SCCM -> SCSM connector automatically.
I really wish the ActiveX control could be brought back as an option for SCSM 2012.
I want my forms as simple as possible, the computer selection via Query Result is clunky and ugly at best, you cant make a default selection/required selection and I simply cant fit it into my forms on one page anyway (having 2 pages forms for a request ruins the end user experience in my opinion).
Obviously for the solution blogged about here to work, you need SCCM, if you have SCCM pushing out an ActiveX control is nothing.
The query result option would obviously still be there for those who prefers it, but for those who want it, please create an ActiveX control for 2012!
Hi, Travis, thanks for this article - saved a lot of my time!
Would you mind, if I'll translate it into Russian and put it into Russian Technet Wiki?
@proxzy - please go ahead. Glad it was helpful to you.
Thank you, Travis, the article is ready and published. Many thanks from russian community :)
Travis, no chance for an activeX control for 2012?