Problem running .IsInRole XP vs 2003

Discussion in 'ASP .Net Security' started by AJT, Jun 24, 2009.

  1. AJT

    AJT Guest

    Hello,

    I hope someone can help shed some light on this as its driving me mad.

    I have a Windows 2003 server that runs Active Directory and IIS and a
    development PC running XP

    If I have in my code HttpContext.Current.User.IsInRole("MyGroup") it
    fails if I am running IIS on my XP pc but if I host my site on the
    2003 server IIS all is ok.

    On getting the groups using the following code

    WindowsIdentity identity = WindowsIdentity.GetCurrent();
    List<string> groups = new List<string>();

    IdentityReferenceCollection identityReferences =
    identity.Groups;

    foreach (IdentityReference identityReference in
    identityReferences)
    {

    NTAccount account =

    (NTAccount)identityReference.Translate(typeof
    (NTAccount));

    groups.Add(account.Value);

    }

    I see that the results returned are quite different on WIndows 2003
    IIS vs XP IIS

    Windows 2003:

    SERVER2\A Taylor
    SERVER2\Domain Users
    Everyone
    SERVER2\MYGroup
    BUILTIN\Administrators
    BUILTIN\Remote Desktop Users
    BUILTIN\Users
    BUILTIN\Pre-Windows 2000 Compatible Access
    NT AUTHORITY\NETWORK
    NT AUTHORITY\Authenticated Users
    NT AUTHORITY\This Organization
    SERVER2\Domain Admins
    SERVER2\MYGroup

    XP:

    SERVER2\A Taylor
    SERVER2\Domain Users
    Everyone
    BUILTIN\Users
    BUILTIN\Administrators
    NT AUTHORITY\INTERACTIVE
    NT AUTHORITY\Authenticated Users
    SERVER2\Domain Admins

    you can see that "MyGroup" doesnt appear for XP.

    Can anyone shed any light on this (or point me to a newsgroup that is
    more suited to this problem)

    Many thanks for your time.
     
    AJT, Jun 24, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arjun

    isInRole Problem

    arjun, Nov 28, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,636
    arjun
    Nov 30, 2004
  2. =?Utf-8?B?UGV0ZXI=?=

    problem with .IsInRole

    =?Utf-8?B?UGV0ZXI=?=, Jan 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    =?Utf-8?B?UGV0ZXI=?=
    Jan 25, 2005
  3. =?Utf-8?B?RGF2ZQ==?=

    IsInRole problem?

    =?Utf-8?B?RGF2ZQ==?=, Mar 24, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,170
    Elton Wang
    Mar 25, 2005
  4. =?Utf-8?B?SnVsaWE=?=

    IsInRole problem

    =?Utf-8?B?SnVsaWE=?=, Dec 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    328
    Patrick.O.Ige
    Dec 5, 2006
  5. Jim McLeod

    ASP.NET Context.User.IsInRole XP Problem

    Jim McLeod, Jun 7, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    149
    Jim McLeod
    Jun 7, 2004
Loading...

Share This Page