DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: VB Implmentation of CheckTokenMembership

  1. #1
    Felix Padovan Guest

    VB Implmentation of CheckTokenMembership



    Just hoping that someone out there has implemented the CheckTokenMembership
    API call from "ADVAPIP.DLL", in Visual Basic.

    I am looking to do a compare of a users access groups to a list of groups
    from the domain to check if the user is a member of the group.

    Thanks !

    Felix

  2. #2
    L.J. Johnson Guest

    Re: VB Implmentation of CheckTokenMembership

    Felix,

    > Just hoping that someone out there has implemented the

    CheckTokenMembership
    > API call from "ADVAPIP.DLL", in Visual Basic.
    >
    > I am looking to do a compare of a users access groups to a list of groups
    > from the domain to check if the user is a member of the group.


    Unless you already have the user's SID, that seems like a round-about way of
    doing it. Presuming that you know the groups of interest ahead of time (or
    data-drive the list), one alternative is shown at

    http://gethelp.devx.com/techtips/nt_.../10min0498.asp
    http://gethelp.devx.com/techtips/nt_.../10min0598.asp

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>





  3. #3
    L.J. Johnson Guest

    Re: VB Implmentation of CheckTokenMembership

    Felix,

    Sorry, mis-read the question. The API you probably want to use is
    NetUserGetGroups, which retrieves a list of global groups to which a
    specified user belongs (given the user's ID). It will return a array of
    group names which the user belongs. See Karl Peterson's
    http://www.mvps.org/vb/code/NetUser.zip for an example of the usage.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




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