The ConvertStringToSid method converts a string containing a security identifier to a byte array.
Namespace: Microsoft.MetadirectoryServices
Assembly: Microsoft.MetadirectoryServicesEx (in microsoft.metadirectoryservicesex.dll)

Usage

Visual Basic
Dim textSid As String
Dim returnValue As Byte()

returnValue = Utils.ConvertStringToSid(textSid)

Syntax

Visual Basic
<PermissionSetAttribute(SecurityAction.Demand, Unrestricted:=True)> _
Public Shared Function ConvertStringToSid ( _
		textSid As String _
) As Byte()
C#
[PermissionSetAttribute(SecurityAction.Demand, Unrestricted=true)] 
public static byte[] ConvertStringToSid (
		string textSid
)
C++
[PermissionSetAttribute(SecurityAction::Demand, Unrestricted=true)] 
public:
static array<unsigned char>^ ConvertStringToSid (
		String^ textSid
)
J#
/** @attribute PermissionSetAttribute(SecurityAction.Demand, Unrestricted=true) */ 
public static byte[] ConvertStringToSid (
		String textSid
)
JScript
public static function ConvertStringToSid (
		textSid : String
) : byte[]

Parameters

textSid

A string representation of a security identifier.

Return Value

A security identifier.

Exceptions

Exception type Condition
System.ArgumentNullException

The argument is null.

System.ComponentModel.Win32Exception

The Win32 function returns a failure.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

See Also