ActiveDirectoryMembershipUser.ProviderUserKey Property

Definition

Gets the user identifier from the Active Directory data store for the membership user.

public:
 virtual property System::Object ^ ProviderUserKey { System::Object ^ get(); };
public override object ProviderUserKey { get; }
member this.ProviderUserKey : obj
Public Overrides ReadOnly Property ProviderUserKey As Object

Property Value

The user identifier from the Active Directory data store for the membership user.

Examples

The following code example displays the ProviderUserKey property in Security Descriptor Definition Language (SDDL) format by converting it to a SecurityIdentifier object. For the full code required to run the example, see the Example section of the ActiveDirectoryMembershipUser class overview topic.

System.Security.Principal.SecurityIdentifier sidValue =
  (System.Security.Principal.SecurityIdentifier)user.ProviderUserKey;

sid.Text = sidValue.ToString();
Dim sidValue As System.Security.Principal.SecurityIdentifier
sidValue = CType(user.ProviderUserKey, System.Security.Principal.SecurityIdentifier)

sid.Text = sidValue.ToString()

Remarks

The ProviderUserKey property exposes the identifier from the membership data source generically typed as an object. The ProviderUserKey class can be cast as a SecurityIdentifier object.

Applies to