Accessing NT User Groups in ASP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Accessing NT User Groups in ASP

  1. #1
    Joshua Gunder Guest

    Accessing NT User Groups in ASP


    Hello, I can access NT user names in ASP using the
    server variable LOGON_USER, or REMOTE_USER.
    But now I need the ability to read a users Group
    within the context of an ASP page.

    So far I have controlled group permissions
    at the file system level. However now I need the ability
    to grant/deny permission, not to a certain file, but
    to certain links, functions, etc within an ASP application.

    [
    If Request.ServerVariables("REMOTE_USER") = "jgunder" Then
    Call SubAdminText
    Else
    Call SubUserText
    End If
    ]

    When what i really need is something like

    [
    If Request."Users NT GROUP??" = "Administrators" Then
    Call SubAdminText
    Else
    Call SubUserText
    End If
    ]

    Of course, IF this is possible, then the code would probably
    have to be iterative since a user can reside in many groups.


    Within ASP, accessed through http, is there a way to determine
    what groups an NT user is a member of?
    This is on NT4 IIS4.

    Thanks
    Josh

  2. #2
    James Dooley Guest

    Re: Accessing NT User Groups in ASP

    Have a look at ADSI it should be able to handle this for
    you. Do a search on MSDN and you'll find some
    examples.

    James.
    http://www.siteknowhow.com

    Joshua Gunder <jgunder@comarco.com> wrote in message
    news:39ae9dc3$1@news.devx.com...
    >
    > Hello, I can access NT user names in ASP using the
    > server variable LOGON_USER, or REMOTE_USER.
    > But now I need the ability to read a users Group
    > within the context of an ASP page.
    >
    > So far I have controlled group permissions
    > at the file system level. However now I need the ability
    > to grant/deny permission, not to a certain file, but
    > to certain links, functions, etc within an ASP application.
    >
    > [
    > If Request.ServerVariables("REMOTE_USER") = "jgunder" Then
    > Call SubAdminText
    > Else
    > Call SubUserText
    > End If
    > ]
    >
    > When what i really need is something like
    >
    > [
    > If Request."Users NT GROUP??" = "Administrators" Then
    > Call SubAdminText
    > Else
    > Call SubUserText
    > End If
    > ]
    >
    > Of course, IF this is possible, then the code would probably
    > have to be iterative since a user can reside in many groups.
    >
    >
    > Within ASP, accessed through http, is there a way to determine
    > what groups an NT user is a member of?
    > This is on NT4 IIS4.
    >
    > Thanks
    > Josh




  3. #3
    Joshua Gunder Guest

    Re: Accessing NT User Groups in ASP


    But don't you have to be running active directory for
    that to work? I'm not running any services like that
    on my NT.

    "James Dooley" <james@siteknowhow.com> wrote:
    >Have a look at ADSI it should be able to handle this for
    >you. Do a search on MSDN and you'll find some
    >examples.
    >
    >James.
    >http://www.siteknowhow.com
    >
    >Joshua Gunder <jgunder@comarco.com> wrote in message
    >news:39ae9dc3$1@news.devx.com...
    >>
    >> Hello, I can access NT user names in ASP using the
    >> server variable LOGON_USER, or REMOTE_USER.
    >> But now I need the ability to read a users Group
    >> within the context of an ASP page.
    >>
    >> So far I have controlled group permissions
    >> at the file system level. However now I need the ability
    >> to grant/deny permission, not to a certain file, but
    >> to certain links, functions, etc within an ASP application.
    >>
    >> [
    >> If Request.ServerVariables("REMOTE_USER") = "jgunder" Then
    >> Call SubAdminText
    >> Else
    >> Call SubUserText
    >> End If
    >> ]
    >>
    >> When what i really need is something like
    >>
    >> [
    >> If Request."Users NT GROUP??" = "Administrators" Then
    >> Call SubAdminText
    >> Else
    >> Call SubUserText
    >> End If
    >> ]
    >>
    >> Of course, IF this is possible, then the code would probably
    >> have to be iterative since a user can reside in many groups.
    >>
    >>
    >> Within ASP, accessed through http, is there a way to determine
    >> what groups an NT user is a member of?
    >> This is on NT4 IIS4.
    >>
    >> Thanks
    >> Josh

    >
    >



  4. #4
    James Dooley Guest

    Re: Accessing NT User Groups in ASP

    Yes, but if you've been keeping up with the service packs etc... I think
    you'll find it is already installed! I've yet to come across an NT box
    that it was NOT installed on. In any case you can download it from
    MS and it is only a couple of hundred K.

    Regards,

    James.


    "Joshua Gunder" <jgunder@comarco.com> wrote in message
    news:39b04b02$1@news.devx.com...
    >
    > But don't you have to be running active directory for
    > that to work? I'm not running any services like that
    > on my NT.
    >
    > "James Dooley" <james@siteknowhow.com> wrote:
    > >Have a look at ADSI it should be able to handle this for
    > >you. Do a search on MSDN and you'll find some
    > >examples.
    > >
    > >James.
    > >http://www.siteknowhow.com
    > >
    > >Joshua Gunder <jgunder@comarco.com> wrote in message
    > >news:39ae9dc3$1@news.devx.com...
    > >>
    > >> Hello, I can access NT user names in ASP using the
    > >> server variable LOGON_USER, or REMOTE_USER.
    > >> But now I need the ability to read a users Group
    > >> within the context of an ASP page.
    > >>
    > >> So far I have controlled group permissions
    > >> at the file system level. However now I need the ability
    > >> to grant/deny permission, not to a certain file, but
    > >> to certain links, functions, etc within an ASP application.
    > >>
    > >> [
    > >> If Request.ServerVariables("REMOTE_USER") = "jgunder" Then
    > >> Call SubAdminText
    > >> Else
    > >> Call SubUserText
    > >> End If
    > >> ]
    > >>
    > >> When what i really need is something like
    > >>
    > >> [
    > >> If Request."Users NT GROUP??" = "Administrators" Then
    > >> Call SubAdminText
    > >> Else
    > >> Call SubUserText
    > >> End If
    > >> ]
    > >>
    > >> Of course, IF this is possible, then the code would probably
    > >> have to be iterative since a user can reside in many groups.
    > >>
    > >>
    > >> Within ASP, accessed through http, is there a way to determine
    > >> what groups an NT user is a member of?
    > >> This is on NT4 IIS4.
    > >>
    > >> Thanks
    > >> Josh

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center