psychoric still trying to figure out what this blog is about

if you are on 64bit and your VS IDE hang when you try to "View in Browser", change the default browser. Works for me!
4Dec/080

Which group(s) am I in?

If you are working in an Active Directory environment and you do utilize it for authentication in your project, this snippet might come handy. It lists the group(s) that current authenticated user belongs to, so you can expand on this to do whatever you need to.

using System.Security.Principal; //do this to save time in typing
 
foreach (IdentityReference ref in WindowsIdentity.GetCurrent().Groups) //get current user group(s)
	Console.WriteLine(ref.Translate(typeof(NTAccount)).ToString()); //translate it to meaningful value
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


Trackbacks are disabled.