title: SharePoint - How to assign a task to a user that's not in the system?
body: <p>I have to programmatically create a task for a user that was not explicitly added in the site users. He has permissions to contribute to the task list, though, because he belongs to an AD group that has been granted those permissions. I can assign the task to the user through the UI; how do I do it through code though?</p>
  
  <p>The accepted way of assigning tasks to users is to set the <code>AssignedTo</code> field of the task to an <code>SPFieldUserValue</code> pointing to that user. Except it cannot be done in this case, because the users cannot be found in SharePoint, only his group! Assigning the task to the whole group is a bad idea, for obvious reasons. And our system administrators categorically refuse to add the users to Sharepoint one by one, because that would duplicate the data they have in Active Directory, and generally be a pain to manage. What do I do?</p>