Поделиться через


Manager.DomainFromMemberName

Manager.DomainFromMemberName

The DomainFromMemberName method returns a user's domain name as a string.

Syntax

Function Manager.DomainFromMemberName([memberName]) As String

Parameters

  • memberName
    Optional parameter that indicates the name of the Microsoft® .NET Passport user.

Return values

The DomainFromMemberName method returns the user's domain name. If the memberName parameter is NULL when calling the method, the domain name of the user currently signed in to the page is returned.

Example

The following Microsoft Visual Basic Scripting Edition (VBScript) code snippet uses the DomainFromMemberName method to display the domain name for the user.

...
'Create a Passport Object
Dim oMgr
Set oMgr = Server.CreateObject("Passport.Manager")

Response.Write ("<br>DomainFromMemberName('abc@anycompany.com') = " & oMgr.DomainFromMemberName("abc@anycompany.com"))
Response.Write ("<br>DomainFromMemberName('Default') = " & oMgr.DomainFromMemberName("Default"))
Response.Write ("<br>DomainFromMemberName('abcdefg') = " & oMgr.DomainFromMemberName("abcdefg"))
Response.Write ("<br>DomainFromMemberName() = " & oMgr.DomainFromMemberName())
Response.Write ("<br>DomainFromMemberName = " & oMgr.DomainFromMemberName)
Response.Write ("<br>DomainFromMemberName(oMgr.Profile('MemberName')) = " & oMgr.DomainFromMemberName(oMgr.Profile("MemberName")))
...

For an authenticated user, the preceding example produces an output similar to the following:

DomainFromMemberName('abc@anycompany.com') = anycompany.com
DomainFromMemberName('Default') = Default
DomainFromMemberName('abcdefg') = Default
DomainFromMemberName() = passport-ppe.com
DomainFromMemberName = passport-ppe.com
DomainFromMemberName(oMgr.Profile('MemberName')) = passport-ppe.com

Remarks

The DomainFromMemberName method is used for obtaining the domain name of a currently signed-in user. It is usually called with no input parameter. If a memberName that does not fall within an existing domain authority (as declared in the Component Configuration Document) is supplied, the string "Default" is returned.

See Also

Passport Manager Object