Wednesday, August 09, 2006

User Profile Event handling?

I was researching into user profiles, as one of my objectives is to get any change a user does to his profile and then act on the change - copying the values to other systems in the network.

Since we need the replication to be immidiate and we cannot rely on a scheduled job like MIIS or other solutions, I could only think of two ways to achive it:

  1. Redevelop the "EditProfile.aspx" page, and override the form submit so it is handled by my code.
  2. Find a way to hook into the "profile changed" event.

Now, the first option is an ugly business. I would prefer not to mess around rewriting code that Microsoft was kind enough to supply me with! The EditProfile page is complex enough with the new choice fields, and person fields for me and with the access-security functions, I really dont want to change it unless I find no other way.

The second option is my favorite one - write an event handler and listen for profile changes.

Angus Logan from Microsoft told me to take a look at the MSDN article "User Profiles and Audience Targeting Overview" which says in the end "SharePoint Server 2007 also offers an eventing model to track deletions and other actions on the user profiles." This sounds GREAT! exactly what I need, right?

Well - I looked and looked and found absolutly no other referance to this "eventing model". The only thing I managed to find after looking in the object model is an enumeration class "SPAuditEventType" that includes a value of "ProfileChange" . There is no documentation how to use it, and I am still looking into it. Any suggestions?

1 comment:

Anonymous said...

Hi ,
That's a great blog.
I have one query regarding event handling . Just wanted to know if V2 event handlers if installed in V3 will work ? as presently my event handlers are not firing in V3 which are working in V2

Thanks ,