ProfileService.BindAs

Ee799036.c++_on(en-US,CS.10).gifEe799036.vb_off(en-US,CS.10).gif

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

Definition

Sub BindAs(sUserName As String,sPassword As String)

Parameters

sUserName

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

sPassword

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

Return Values

None.

Error Values

The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see ProfileService.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.

Example

' oProfileService is a Commerce ProfileService object

oProfileService.BindAs "JoeUser@microsoft.com", "MyPassword123"
oProfileService.BindAs "DomainName\JoeUser", "MyPassword123"

See Also

ProfileService Object

ProfileService.UnBind


All rights reserved.