1 out of 4 rated this helpful - Rate this topic

SPWeb.EnsureUser Method

Windows SharePoint Services 3
Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
public SPUser EnsureUser (
	string loginName
)

Parameters

loginName

A string that contains the login name.

Return Value

An SPUser object that represents the user.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Requires that the current user is a Site Admin and that the authentication method is AD
Here's the reflected code for the method: