IProfileService::BindAs

Ee799035.c++_off(en-US,CS.10).gifEe799035.vb_on(en-US,CS.10).gif

Use this method to set the credentials used to access ProfileObject objects in the underlying Profiles store.

Definition

HRESULT IProfileService::BindAs(BSTRsUserName,BSTRsPassword,);

Parameters

sUserName

[in] A BSTR that contains the user name for accessing ProfileObject objects.

sPassword

[in] A BSTR that contains the password for accessing ProfileObject objects.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_Errors.

Remarks

This method sets the credentials used to access and modify ProfileObject objects in the underlying directory store. Any new ProfileObject objects or modifications will be bound to these credentials. The specified credentials define the security context under which all subsequent ProfileObject object operations will be performed, until the UnBind method is invoked. The credentials specified here will be used as is to bind to the underlying directory stores. It is the responsibility of the client to pass in these credentials in the appropriate format. For example, to bind to Active Directory one could pass in either the

  • Full User Principal Name (UPN) (for example, joeuser@domain.com), or

  • SAM Account Name (for example, Domain\SAMAccountName), or

  • Fully specified distinguished name of the security principal (for example, CN=joeuser, CN=Users, DC=Domain, DC=com).

For Membership Directory, you must specify the fully specified distinguished name of the security principal.

Use the UnBind method to clear the credentials.

Call the Initialize method before you use this ProfileService method.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

See Also

ProfileService Object

IProfileService::UnBind


All rights reserved.