Thursday, June 4, 2009

Create a set with all objects having a non-empty attribute (i.e. XPath filter for 'child exists')

Today I answered a question on the FIM forums, and I thought I'd publish it for reference.

Objective
How can we create a Set of objects whose certain attribute is not blank (meaning that the attribute exists)? For example, how do we create a Set of all people who have a JobTitle assigned? The FilterBuilder won't let you do something like Job Title is not        .

Solution
The answer is that we have to edit the Set's XPath filter manually.

But first, a quick note on semantics. :) In FIM we talk about objects and their attributes, but 'attribute' is something different in XML (which is what XPath is operating on). So, the objective for our XPath query is to find all nodes whose child node (of a certain name) is not blank.

  1. We can begin by using the filter builder as a crutch. Create the following filter with the filter builder:

    Select people that match all of the following conditions:
    Job Title is not junk

    If you view membership, it will give you all people who don't have a job title; and the filter will be:

    /Person[not(JobTitle = 'junk')]

  2. Finish & submit the Set creation.

  3. Go back and edit the Set; Click on Advanced View, and change the filter manually to:

    /Person[JobTitle != 'junk']

  4. Finish and submit the changes.

Now, if you do an XPath query for /Set[DisplayName = 'Those with job title']/ComputedMember, you'll see all people who do have a job title (provided you don't actually have a job title named 'junk').

Monday, May 4, 2009

Webinar recording & slides posted

We've posted the video recording of my April webinar, and you can also download the presentation in PDF format.

Ensynch IDA Resources

Note that I've corrected myself since the webinar. The Enumerate Resources activity does indeed work; there's just a trick to making it work. Please find that trick in my previous post.

Thursday, April 30, 2009

Henrik Nilsson's RegexReplaceActiviy

Henrik just made a great post about his RegexReplaceActivity. In it, he shows you how to capture the power of regular expressions (pun intended :).

While you're developing and tuning your regular expressions, it's handy to have a quick way to test them. I'd like to point you to a phenomenal online resource for testing regex patterns:

http://gskinner.com/RegExr/

If you paste Henrik's sample regex pattern into the site, and then type a date into the text box, it'll highlight the pattern that's matched. Then, if you hold your mouse over the highlighted pattern, it'll show you the groups that are captured. Instant gratification!

Tuesday, April 28, 2009

How to use EnumerateResourcesActivity in RC0

Last week during my webinar, I wasn't sure how to use the EnumerateResources or EnumerateResourceIteration activities. I thought I'd tie up some loose ends and try to crack this case. Thanks to Henrik and Nima, I was able to get the EnumerateResourcesActivity to work. Turns out that the Iteration activity will be removed from RTM.

Per Henrik's advice, EnumerateResources has the wrong designer, so when you add the activity to a custom workflow, you'll notice that it's closed and you can't add any children to it.



You can work around this by opening the Designer.cs file and adding a code activity to it manually. First, add a CodeActivity to the class:

private CodeActivity codeActivity1;

Next, add the code activity to EnumerateResources in InitializeComponent, before the last line, "this.CanModifyActivities = false;".

#region Workaround
this.codeActivity1 = new System.Workflow.Activities.CodeActivity();
//
// codeActivity1
//

this.codeActivity1.Name = "codeActivity1";
this.codeActivity1.ExecuteCode += new System.EventHandler(this.logIteration);

this.enumerateResourcesActivity1.Activities.Add(this.codeActivity1);
#endregion

Then, create a "logIteration" method in your main class file, and call the GetCurrentIterationItem method from EnumerateResources:

private void logIteration(object sender, EventArgs e)
{
// Log the Resource properties to a string
StringBuilder buffer = new StringBuilder();
buffer.AppendLine("TotalResultsCount : " +
enumerateResourcesActivity1.TotalResultsCount);

ResourceType currentItem = EnumerateResourcesActivity.GetCurrentIterationItem(
(CodeActivity)sender) as ResourceType;

if (currentItem != null)
{
// Resource properties
foreach (KeyValuePair<string, ResourcePropertyInfo> property in currentItem.ResourceProperties)
{
// Attribute name
buffer.Append(property.Key.PadRight(20));
// Attribute type
buffer.Append(property.Value.Type.PadRight(20));
// Value
object val = currentItem[property.Key];
if (val != null)
{
buffer.AppendLine(val.ToString());
}
else
{
buffer.AppendLine();
}
}
}

// Finally, do something with the log message
string output = buffer.ToString();
}

That's it. Don't forget to bind the XPathFilter property on the EnumerateResourcesActivity. Perhaps I'll add an example to our activity library.

Enjoy!

Friday, April 17, 2009

ILM 2 password client install snafu

I encountered the following error while attempting to install the password reset client from the ILM 2 program folder (C:\Program Files\Microsoft Identity Management\Web Portals\WSSDir\PasswordManagementClient\ilm-client.msi). I couldn't find much help from an internet search, but David Lundell pointed out my problem. It was a silly but honest mistake, so I thought I'd document it.

Office integration requires Smart Tags .Net Programmability Support. Please install it from the Office CDs (under Office Tools) and try again.



It turns out that, in my haste, I had selected all the defaults of the installation, which is an honest mistake. Since I was installing this on the dev server box for testing, I didn't have Office installed, yet I left the Office Integration component selected for install. The simple answer is to deselect this option during install.



Hope this helps!

ILM2/FIM Custom Workflow Development Webinar

I'll be hosting a webinar geared toward development next week. Please attend and bring your burning questions!

 

When:
Thursday, April 23rd

Where:

Webinar/Online
(LiveMeeting links will be
sent to all registrants)

Presenter:
Joe Zamora, Ensynch Senior Developer, Identity and Access Management


Time:
9am-10am Pacific/Arizona
(GMT-7)
10am-11am Mountain
11am-12pm Central
12pm-1pm Eastern

 


Webinar:
Custom Workflows in Identity Lifecycle Manager "2" - Ask the Experts!

You’re invited to attend an informational webinar and technical overview of custom workflows, features and functions available in Identity Lifecycle Manager “2” (ILM 2). This webinar is designed for technical experts who want to gain an understand of the features and benefits of ILM 2 custom workflows to achieve information technology operational efficiency. ILM 2 will dramatically change the way organizations manage information. There is a lot to be excited about, and a spectrum of new features that you’ll need to understand to intelligently discuss how it will impact your business.

Ensynch is proud of our world-class Identity and Access Management practice, led by David Lundell, Brad Turner, both Microsoft MVPs for ILM, along with Joe Zamora, Senior Developer. This team's efforts have earned Ensynch back to back Microsoft World-Wide Partner Awards for Identity Management in 2007 and 2006. Take advantage of this opportunity to learn from their vast enterprise and mid-market experience in incorporating Best Practices in assessing, planning, deploying and managing highly efficient environments with the latest technologies.


Agenda:

ILM “2” Custom Workflow Overview (25 min)
• Motivation
- Out-of-box toolset
- Challenges

• Resources
- SDK
- Connect
- Community content, contributions and resources

• Tools
- Visual Studio workflow designer
- Building block activities
- Public Resource Management Client
- Hidden gems

Demo (25 min)
• Ensynch ILM “2” Activity Library
- Update Attribute Activity
- Owner Rollup Activity
- Generate OID Activity

Question & Answer (10 min)

(Register Now)

 

Source code posted

We've finally posted the source code to Brad Turner's TEC 2009 workshop. Sorry for the delay; project deliveries are always getting in the way; you know how it goes.

ILM 2 RC0 Ensynch Custom Workflow Activity Library

And a few screen shots for you...





Sorry for the lack of description on these, but I'll be hosting a webinar on them next week. More details on that coming soon...