BindAs Method

This method sets the credentials used when binding to the ADSI object defined by the AUO entry specified.

IDL Definition

HRESULT BindAs(
BSTR bszEntryName,
BSTR bszUserName,
BSTR bszPassword
);

Parameters

bszEntryName

The name of the AUO entry to change binding credentials on.

bszUserName

The distinguished name to use when binding.

bszPassword

The password to use when binding.

Return Value

A standard HRESULT value.

Remarks

The Init method must be called before BindAs.  This loads the entries defined for a particular Membership virtual server instance.

The distinguished name (DN) is the full path to the user as it appears in the underlying directory service.  (e.g. in an LDAP service: /o=company/ou=admingroup/cn=John")

This method can only be invoked prior to the binding of any ADSI objects. Once an ADSI object has been bound by the object, the binding credentials cannot be changed, and any further invocations of the BindAs method will fail.

This method only changes the binding credentials for the lifetime of the class UserObjects object. To permanently change binding credentials for an AUO entry, see

Example

<% Set UserObjects = Server.CreateObject(“Membership.UserObjects”)
   UserObjects.BindAs(“o=company/ou=public/cn=publicuser”,”password”)
%>

See Also

Class AuoConfig


© 1997-1998 Microsoft Corporation. All rights reserved.