CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Posts
    10

    Determining User Groups in VBA

    Hi all.
    I am currently developing an application in MS Access 97, but I don't want to use Access' security mechanism for validation. Instead, I was hoping to find an API that would allow me to add users to a pre-defined group in NT, and check wether the logged in user belongs to this group or not.. Is there an easy way to do this? I can easily get the username, but there seems to be alot of hassle trying to determine which group he/she belongs to.. HELP!


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Determining User Groups in VBA

    the following script was published in the NT FAQ by John Savill (www.ntfaq.com)
    It is based on ADSI. You can download the SDK from the MSSite


    on error resume next
    strUser="UserID"
    set oDomain=GetObject("WinNT://YourDomain")
    set oUser=oDomain.Create ("user", strUser)
    If (err.number=0) then 'If not 0 then user ID already exists
    oUser.SetInfo
    oUser.SetPassword "mypassword"
    oUser.SetInfo
    End If
    to update other elements of information you can use
    set user=GetObject("WinNT://domain/user") User.FullName=FirstNameVar
    User.HomeDirectory=UserHome User.Profile="\\Server\Share\user"
    User.LoginScript=LogonScript User.Description="Description"
    User.setinfo





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured