0

I have the isAdministrator(String a) as follows:

public static bool IsAdministrator(String aString)
{
    WindowsIdentity identity = new WindowsIdentity(a);
    WindowsPrincipal principal = new WindowsPrincipal(identity);
    return principal.IsInRole(WindowsBuiltInRole.Administrator);
}

Where aString is a username. When I ran this I realized I need a UPN. Is there anyway around this?

Thanks in advance!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Bob Bobs
  • 1
  • 2

0 Answers0