tags:

views:

471

answers:

3

Hi guys i am new to sharepoint . Actually we are using WSS not the MOSS 2007. we don't have shared service provider installed and no user profile service web service installed.Now I need to populate the active directory data to sharepoint list and after that I have to sync both Active directory and sharepoint list.which means the changes happened to Active directory data it must reflect in sharepoint list also.

What we are doing is extracting active directory data to SQL Server database and populating sharepoint list from SQL server database. I need a solution to populate sharepoint list from SQL Server database and sharepoint list must synchronize with SQL Server database table or stored procedure all the time automatically.

Can anyone suggest me the best solution to solve both importing the active directory data and sync the active directory and sharepoint list.

If anyone of you provide the sample source code that will be helpful.

+1  A: 

1) Have you look into the User Information Lists & User Profiles? Sahil Malik has a very good overview of 'All you ever wanted to know about user profiles'. Keep in mind that because you are using WSS you don't have SSP Admin.

2) If you read the above article you will he mentions "How can profile information be kept up to date, if in case I am not using MOSS (and have no SSP)?" and his answer is an import/export utiltiy, the codebase of which (or even the utility itself) should give you a good start on what you want to do.

3) Also mentioned in the above article is a good diagram on how user information flows.

mundeep
Thank's alot for providing help.it was really helpful
Anoop
+3  A: 

I just want to clarify a bit first. Not sure if you're looking to configure sync for proper user profiles (which mundeep's answer solves nicely) or a generic SP list.

If you're looking to:

AD <-> SharePoint list

It's probably easier to break this problem down into two parts:

AD -> SP list

and:

SP list -> AD

For AD -> SP list

Microsoft provides some guidance on monitoring the AD for changes. Unfortunately, neither of these methods is a specific event message system (if anyone knows of one, please chime in!) both are essentially polling.

I would create a Windows service to handle this part of the solution.

The service would (in pseudo-code):

  • look for records that have changed
  • for each record that has changed:
    • get the matching SP item from the SP list (probably based on username)
    • update/add/remove the properties of the SP item
    • save the SP item

For SP list -> AD

I would create a custom event handler and attach it to the SP list.

Again in pseudo-code:

On SP item delete:

  • remove the matching AD record (if that's the behaviour you want)

On SP item create:

  • create a new AD record

On SP item update:

  • find the matching record in the AD
  • update the changed properties (which are flagged in the SP event handler)

The SP side of things is a little more elegant because events are raised only when something happens. This is definitely more efficient than polling.

What I'm suggesting has the added benefit of removing SQL (explicitly) from the solution. You can use the ADSI interface in the .NET framework to handle the AD update code. It's in the System.DirectoryServices assembly.

The AD polling service could use the SP object model if it's installed on the WSS box or the web services if it's on another system.

Again, if you're just looking to use the actual WSS/SP user profiles, use mundeep's solution.

Mark
Thanks you very much it was a great explanation
Anoop
A: 

Mark, You are awesome! You are the first one I encountered who explained the AD and SharePoint list synchronization so clearly!
Sorry, but I am just wandering do you have any blog? I want take a look! I am sure there are more useful things! Thanks!

tag
thanks. I took my blog down since I wasn't updating it often enough. debating putting it back up (check back at markn.ca).
Mark