Migrating domain name field to People or Grup field

May 18, 2010 at 4:41 PM
Hi, I am migrating a SQL table to a list using the Sharepoint Adapter for SQL 2005. It is working great for most fields, but when I try to map a field which has the domain\username info to a "Person or group" field in Sharepoint, it fails on runtime. I guess I should do a transformation before, so I get the internal id Sharepoint uses for users. Anybody knows how I can achieve such transformation, or suggest an alternative approach? Thank you very much, Manuel
Coordinator
Jun 2, 2010 at 9:00 PM

The adapters currently are only for the data. So you can't load out the user information with them currently.  And yes, you would most likely need the ID to perform the update you're asking about.

 

Jul 13, 2010 at 3:01 PM
Edited Jul 13, 2010 at 3:02 PM

Has anyone come up with an example or ideas of how to deal with this.

I need to copy an assigned to value to a list on another site.  Therefore the ID's are different.

I don't see why we cannot use the "somedomain\\someuser" format, see code example:

 

private void createTask1_MethodInvoking(object sender, EventArgs e)
{
    createTask1_TaskId1 = Guid.NewGuid();
    createTask1_TaskProperties1.AssignedTo = "somedomain\\someuser";
    createTask1_TaskProperties1.Description = "Please approve the
      expense report";
    createTask1_TaskProperties1.Title = "Expense Report Approval
      Needed";
}

Note
In the code, replace somedomain\\someuser with a domain and user name for which a task will be created, such as, "Office\\JoeSch". For testing it is easiest to use the account you are developing with.
 
 

Oct 11, 2010 at 2:46 PM

@mbabuglia - do you still need a solution for this?  I was trying to do do the same thing - updating the CreatedBy field in a SharePoint list, which is of type Person or Group.  

Not sure if this works for other environments, but I finally found that if you point a SharePoint List Source in SSIS to the list "User Information List", you get all users and groups' info from SharePoint.  Let me know if this works.

James