How to Add a Registration Receiver to Capture Data at the Time of Registration
One of the first things that I do when I get something new is make it uniquely my own. When I got my new desk, I broke out the drill and installed a USB Hub. New car… seat covers and dice for my mirror. New house… paint every room in the house (ok, so that one was actually my wife’s choice) but I think there is something about customizing or personalizing that makes the experience feel special and unique in some way. Your SharePoint extranet powered by ExCM should be no different!
AD vs. HUIL
Most people who have worked with SP a while know that Active Directory is the default location that is used to pull user information from. What some do not know is that there is another list that can be populated by AD called the User Information List, or sometimes called the Hidden User Information List. Typically this list is kept in Sync with Active Directory by the User Profile Service taking data from AD and adding it to the HUIL. In this article, we will walk you through how to use this HUIL to store data about your external users.
Here are two examples of the direct link to the HUIL list. Replace example the site url with your site url.
http://sharepointsite/sites/site/_catalogs/users/detail.aspx
http://extranet.awbikes.com/vendors/Acme/_catalogs/users/detail.aspx
SP User Registration
When an internal user logs into a site collection, their First and Last Name is displayed in the top right corner. This information is stored in Active Directory. However, your Forms Based Users are not stored in AD and therefore their user name is typically just their email address. We created the SPUser Registration Receiver to help personalize the experience for your external user and add their first and last name to the user information. The following code is used to accomplish this for us.
<add name="SPUser"
spUserFieldMap="Title=$registrationItem.FieldAnswers.get_Item('FirstName').Value $registrationItem.FieldAnswers.get_Item('LastName').Value;" type="SPSolutions.SharePoint.ExCM.ExtranetSPUserRegistrationReceiver, SPSolutions.SharePoint.ExCM, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fdcedad4c93ea981" />
Assign a Department (built In)
Now that we know about the HUIL and have seen a registration receiver in action, let’s work through setting up our own registration receiver. For this example, we are going to add a new registration field and allow our end-user to assign a department from a drop-down list.
First, let’s create the registration field by adding a global registration field through the Global Application Settings ExCM menu. We could also create a registration field on an individual site collection, in case you have one site collection that you need to collect different information than the rest of your site collections.



Now that the field is there, let’s test to ensure that we did not break anything


We can see that the user was added but nothing is in the department field. To correct this, we now need to add some logic to our web.config file so that we map the answer to the “department” registration field to the department field in the HUIL
Open the Web App’s web.config file by browsing out to the Virtual Directory (in our case C:inetpubwwwrootwssVirtualDirectoriesextranet.awbikes.com80)
Make a backup copy of the web.config file
Search for <registrationReceivers>
Copy the following text and paste just above SPUser line
<add name="SPDepartment" spUserFieldMap="Department=$registrationItem.FieldAnswers.get_Item('Department').Value;" type="SPSolutions.SharePoint.ExCM.ExtranetSPUserRegistrationReceiver, SPSolutions.SharePoint.ExCM, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fdcedad4c93ea981" />

Now that we have the Department registration receiver in place, let's create a new user and test


We can see that the user was created and now has the appropriate department listed as chosen by the drop-down box on the registration page.
Be sure to check out our next post on how to take this a step further and assign a photo-based on registration answer
©2019 PremierPoint Solutions. All Rights Reserved.