SharePoint. Add users from Active Directory to custom admin form.

I have a project where I need to add users to the SharePoint portal, but when I add them, I also need to set the add options in a separate database.

I want to add a custom admin screen where the admin can set these values ​​when they add a user, rather than forcing them to add the user first and then go to a separate interface page where they set the values.

Does anyone know of any good articles that explain how to do this?

Thank.

+1


source to share


1 answer


It would be easier to create an asp.net custom form that will get all the necessary information about the user. then submit can add the information to the required database and use the object model to add users.

SPRoleAssignment MyRoleAssign = new SPRoleAssignment("domain/alias", "email address", "User Name", "Description");
SPRoleDefinition MyRoleDef = newSubWeb.RoleDefinitions["Contribute"];    
MyRoleAssign.RoleDefinitionBindings.Add(MyRoleDef);    
site.RoleAssignments.Add(MyRoleAssign);

      



Code from farhanfaiz.wordpress.com here

Otherwise, SharePoint Web Services may run. Examples here

+1


source







All Articles