SharePoint 2010: Simple way of adding user to a site using Server API

To add a user to a site, a easiest way to do so without much overhead is to use SPWeb.EnsureUser Method.

If the user is not found from AD, an exception will be thrown or else the user will be added to the site without any access privliage.


Comments