Project DescriptionFoundationUPS is a .Net console application that provides user profile service for SharePoint Foundation 2010, synchronizing site collection User Information List (UIL) account information with Active Directory.
We created this application for two main reasons:
- As a way to clean up the people picker (e.g. remove inactive users) and
- So that workflows and forms that are dependent on a users job title would work correctly when job titles changed.
Options can be set to select which web apps are processed as well as which user names to exclude. A runtime argument determines if the UIL will actually be updated or whether it will be dry run. All changes/removals are logged each time the application runs - whether in update mode or in dry run mode.
Accounts in the UIL which are not found in AD or are inactive in AD will be removed from the UIL. UIL accounts active in AD will have various properties (Department, Display Name, Title, etc.) checked and updated with AD information.
In our testing we have found that removing a user account from the UIL does not affect meta data on documents that user may have uploaded to a site (i.e. Created by, Created date, Modified date values are not affected).
Since this is a console application, no changes are made to the SharePoint environment and the application can be set to run from a scheduled task. Also, the application only uses the SharePoint object model. No changes are made directly to the SQL databases.
In the event of an error, an email will be sent to the address set in the config file. The SMTP server used for sending out emails will be the one setup in SharePoint Central Administration for that site collection.
See the documentation section for more details on setting up and running the application.
MethodologyThe application starts by getting a reference to the local SharePoint farm. It then goes through each web service and for each web service it looks at each web application. If the web application is contained in the config file (see the documentation section for details on setting up the config file), it then processes the UIL for each site collection in that web app.
The application only updates the following UIL account properties:
- Email address - mapped to AD "EmailAddress" field
- Title - mapped to AD "DisplayName" field
- Department - mapped to AD "Department" field
- Job Title - mapped to AD "Description" field (yes, I know, why the Description field and not the Title field. It just happens that we use the Description field in AD to store the users title.)
Any of these can be changed and others added by modifying the source code.
Logging is provided by a simple logging class. In our environment, it is part of a class library in the form of a dll added to the server GAC. For this project, I've added the code (LogFile.cs) to the main project so it's easy to modify/remove.