What is the role of SPWeb.EnsureUser method?

Submitted by: Administrator
SPWeb.EnsureUser method validates whether the specified login name belongs to a valid user of the website or not. If the login name does not exist then it adds the login name to the website.

Eg:

Dim instance As SPWeb

Dim loginName As String

Dim returnValue As SPUser

returnValue = instance.EnsureUser(loginName)
Submitted by: Administrator

Read Online MOSS Job Interview Questions And Answers