Software Development Network>> .NET Development>> Convertig objectSID (or SID) to String (vb.net 2005)
Dim
If you want the SID as a string create an instance of SecurityIdentifier.
SecurityIdentifier sid =
If you want the name of the account associated with the SID then call Translate on the sid.
NTAccount act = (NTAccount)sid.Translate(typeof(NTAccount));
The returned account is the friendly name (if available) for the SID.
Michael Taylor - 1/5/06
Convertig objectSID (or SID) to String (vb.net 2005)
E.Ganesan
oscarg102941
Dim
act As NTAccount = CType(sid.Translate(Type.GetType("System.Security.Principal.NTAccount")), NTAccount)Sylvain Bougnoux
If you want the SID as a string create an instance of SecurityIdentifier.
SecurityIdentifier sid =
new SecurityIdentifier(sidString);If you want the name of the account associated with the SID then call Translate on the sid.
NTAccount act = (NTAccount)sid.Translate(typeof(NTAccount));
The returned account is the friendly name (if available) for the SID.
Michael Taylor - 1/5/06