Thursday, November 30, 2006

Windows User: SID and name

I wasted much time trying to find easy way how in C# .NET get SID by user name and back, w/o writing C++ dll. I already spend two days once for such dll, but I lost it or something. However, I spent two hours in google groups and web search, untill I found so nice article.

Sections import Win32 functions to C#, and two functions.

Import section

GetSid(string name)


GetName(string sid)


links:
http://www.codeproject.com/cs/library/sidtranslator.asp
http://support.microsoft.com/kb/157234

No comments: