Using Rightfax Sync Module to Synchronize Group Memberships
When I came in today, a colleague asked me a bizarre question. I had to think about it and as we discussed it, several others joined in giving their own opinions. All of us had differing opinions on what would happen. Naturally of course, I knew that I was correct and they were all wrong, but I wanted to be able to prove it. First, let me tell you what the problem is:
There is a customer who is synchronizing their users from Active Directory into Rightfax. Now many of the users are only working for a short time then they leave. Sometimes they don’t leave but move to a different part of the organization. So what happens to that Rightfax user when they are moved in AD from one group to another? The customer has several Sync Mappings targeting different groups and each mapping defines a special coversheet, group membership, etc. When the user is moved to a different AD group, is there a way to get the new RF group membership to be applied?
What do you think? Some of my colleagues said no, there was no way to synch that AFTER initial user creation. One said that a second user would be created even though they were the same user.
Well, the answer is both yes and no. Using the standard way of configuring the Sync Module, the answer is no. But after spending about 30 minutes looking into it using only publicly available resources (well, public for registered users), I found a solution. But before I go into the solution, let me tell you why the standard answer is no.
The Sync Module is part of Rightfax that synchronizes users from Active Directory or LDAP to Rightfax. For more information about the Sync Module, see my previous article on this topic. There are about 12 standard attributes that are synched from AD to Rightfax. But group membership, coversheets, etc are not in that list of 12. For those things to be set, the standard answer is to set them in a special default user for that mapping, and then all of those details will be set. But that default user is only referenced on initial creation of the Rightfax user.
So here is how to solve this problem. Before actually attempting anything like this, test on a non-production system. In order to set anything after the initial user creation, you have to edit the XSL document that defines the mapping. Now that may sound scary, but really its not. Here is the entire process I used to figure it out:
- First go to the directory that contains the XSL files and make a copy of one of them as a starting point. The directory is going to be CapaSync\config off of you Rightfax program directory.
- Open the file in an editor. I happen to use PSPad, but notepad would be fine as well. Find any existing line that starts with <xsl:template. Insert this on the next line:
<attr name=""> <value></value> </attr>
- Now we need to figure out how to fill in the details. I want to use this to synchronize group membership. All the users in one AD organizational unit will be a member of one RF group. Members of another OU will be a member of a different RF group. What I need to find is the attribute to use to set the RF group. The list of all possible attributes lives at this page on the Open Text Knowledge Center. Login using your credentials to see the article. If you don’t have the rights to see the article, then contact your Open Text representative to organize those rights.
- I can see that the only item that starts with the word Group is GroupID and that the value will be an integer. So now my XSL has become:
<attr name="GroupID"> <value></value> </attr>
- I still need a value to use. I took a look in the database to see what my choices were. While waiting for SQL Management Studio to open, remember this. DON’T WRITE ANYTHING TO YOUR DATABASE!! Reading is not a problem, but writing to your database means breaking stuff. Inside the Groups table I could see a few things that might work. The most obvious was a column called GroupID. This was the actual name of the group. By the time I saw this, I had forgotten about the need for the value to be an int, so I tried it. Nothing happened. In the event log I saw an error saying there was a conflict with the column ‘handle’. That’s when I remembered the need for an int. Well, the handle column contains ints and its usually how we refer to objects in Rightfax. So I tried that.
- The handle for my first group was 100663298 so my XSL now became:
<attr name="GroupID"> <value>100663298</value> </attr>
Guess what, this worked. I then made a second copy of the XSL file and set up a second GroupID. Soon after I moved a user from the first group to the second in AD, the group membership in Rightfax changed as well.
The real secret to get this to work is finding the right value in that KC article, then putting a value in that it expects. A little trial and error and you should have a more customized XSL that works for your needs.


February 25, 2010 



