SharePoint How to assign a task to a user, and not to the system?

I need to programmatically create a task for a user who has not been explicitly added to the site users. He has permissions to contribute to the task list, although he belongs to the AD group to which these permissions were granted. I can assign a task to a user through an interface; How can I do this with code?

The accepted way to assign tasks to users is to set the AssignedTotask field to SPFieldUserValuepointing to that user. Except that it is impossible to do in this case, because users cannot be found in SharePoint, only its group! Assigning a task to an entire group is a bad idea for obvious reasons. And our system administrators categorically refuse to add users to Sharepoint one by one, because this will duplicate the data that they have in Active Directory, and, as a rule, are a pain in management. What should I do?

+3
source share
1 answer

SharePoint, , AD.

, (TGroupsUser) (SPtestPermissions) AD, , - . "Member" . SP .

, SPWeb, - . , SPWeb . , . . . - . - . - , , . , .

SPSDEV\rross SPSDEV\sptestpermissions SPSDEV\TGroupsUser

SPSDEV\rross SPSDEV\sptestpermissions SPSDEV\TGroupsUser

SPSDEV\rross

(TgroupsUser) , , , . , assignTo.

TaskItem[SPBuiltInFieldId.AssignedTo] = web.SiteUsers.GetByEmail("myemail@domain.com");

, TGroupsUser. enter image description here

FYI - AllowUnsafeUpdates -.

0

All Articles