Если вы используете .NET 3.5 или новее, вы можете использовать этот код (после добавления ссылки на новое пространство имен System.DirectoryServices.AccountManagement
в ваш проект):
using System.DirectoryServices.AccountManagement;
// create a machine-context (local machine)
PrincipalContext ctx = new PrincipalContext(ContextType.Machine);
UserPrincipal up = UserPrincipal.FindByIdentity(ctx, IdentityType.Sid, <YourSidHere>);
if (up != null)
{
Console.WriteLine("You've found: {0}", up.DisplayName);
}
else
{
Console.WriteLine("ERROR: no one found");
}