|
-
August 10th, 1999, 09:20 AM
#1
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!
-
August 10th, 1999, 09:47 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|