|
-
July 23rd, 2002, 01:03 PM
#1
WindowsPrincipal.IsInRole question
I can't understand why these keeps occuring. The following section of code should output two lines saying true:
Code:
WindowsIdentity MyIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal MyPrincipal = new WindowsPrincipal(MyIdentity);
Console.WriteLine(MyPrincipal.IsInRole(WindowsBuiltInRole.Administrator));
Console.WriteLine(MyPrincipal.IsInRole("Administrator"));
Instead, the second IsInRole returns false. I've tried domain\username also and I get the same behaviour. I've also created a testgroup and hadded myself to it. Yet again, it fails. Perhaps I'm missing something?
-
July 23rd, 2002, 04:44 PM
#2
Re: WindowsPrincipal.IsInRole question
Originally posted by CPCericola
I can't understand why these keeps occuring. The following section of code should output two lines saying true:
Code:
WindowsIdentity MyIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal MyPrincipal = new WindowsPrincipal(MyIdentity);
Console.WriteLine(MyPrincipal.IsInRole(WindowsBuiltInRole.Administrator));
Console.WriteLine(MyPrincipal.IsInRole("Administrator"));
Instead, the second IsInRole returns false. I've tried domain\username also and I get the same behaviour. I've also created a testgroup and hadded myself to it. Yet again, it fails. Perhaps I'm missing something?
I've tried the same thing and I"m getting the same error. It's very baffling.
Jared
-
July 23rd, 2002, 04:46 PM
#3
Re: Re: WindowsPrincipal.IsInRole question
Originally posted by jparsons
I've tried the same thing and I"m getting the same error. It's very baffling.
I think I figured it out. It's talking about the Domain/Computer role not group. If I'm not mistaken, isn't there a difference between these two?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|