UserGroup.GetUserLoginFromEmail Method
Returns a user name based on the specified e-mail address.
Namespace: [UserGroup Web service]
Web service reference: http://Site/_vti_bin/UserGroup.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/directory/GetUserLoginFromEmail", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetUserLoginFromEmail ( _
emailXml As XmlNode _
) As XmlNode
'Usage
Dim instance As UserGroup
Dim emailXml As XmlNode
Dim returnValue As XmlNode
returnValue = instance.GetUserLoginFromEmail(emailXml)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/directory/GetUserLoginFromEmail", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/directory/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/directory/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetUserLoginFromEmail(
XmlNode emailXml
)
Parameters
emailXml
Type: System.Xml.XmlNodeA System.Xml.XmlNode object that specifies the e-mail address of the user.
Return Value
Type: System.Xml.XmlNode
An XML fragment in the following form that specifies the user name (DOMAIN\User_Alias) and other information that can be assigned to a System.Xml.XmlNode object.
<GetUserLoginFromEmail xmlns="https://schemas.microsoft.com/sharepoint/soap/directory/">
<User Login="DOMAIN\User1_Alias" Email="User1_Email"
DisplayName="User1_Display" SiteUser="0"></User>
<User Login="DOMAIN\User2_Alias" Email="User2_Email"
DisplayName="User2_Display" SiteUser="1"></User>
.
.
.
</GetUserLoginFromEmail>
Examples
The following code example displays the user names of three users on the current Web site based on their e-mail addresses. The example uses an XmlDocument object to create XmlNode objects for parameters. This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.
Dim usrgrpService As New Web_Reference_Folder_Name.UserGroup()
usrgrpService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim xmlDoc = New System.Xml.XmlDocument()
Dim ndLogin As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Users", "")
ndLogin.InnerXml = "<User Email='User1_Email'/><User Email='User2_Email'/>" + "<User Email='User3_Email'/>"
Dim ndReturn As XmlNode = usrgrpService.GetUserLoginFromEmail(ndLogin)
MessageBox.Show(ndReturn.OuterXml)
Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndLogin = xmlDoc.CreateNode(XmlNodeType.Element,"Users","");
ndLogin.InnerXml = "<User Email='User1_Email'/><User Email='User2_Email'/>" +
"<User Email='User3_Email'/>";
XmlNode ndReturn = usrgrpService.GetUserLoginFromEmail(ndLogin);
MessageBox.Show(ndReturn.OuterXml);