views:

18

answers:

1

I'm having a bit of a problem with an application I am writing in C#. I can't seem to find a way to check if a user is an administrator just from their username and password. I haven't seen anything helpful for doing this elsewhere and all tries to attempting such with WindowsIdentity end up helpless. I am aware of UAC programming with Windows Vista and Windows 7, however I plan on supporting Windows XP; thus rendering the possibility of using administrator access via UAC unlikely. I am only looking for a way of creating a method that takes the string Username and string Password and returns the boolean of if the credentials refer to an administrator account.

Is there any feasible way of doing this?

Thanks.

+1  A: 

Here's an SO question that might help you out.

Also, the MSDN entry for WindowsImpersonationContext has a good example.

msergeant
Just what I was looking for, thanks mate.
JonnyLitt