Markus said:
I would like to eliminate the need to login to my app by using Active
Directory (AD). That is, if a valid user has logged in to the network (AD
login) then I will assume they have the right to run my app. However, I
still need to add them to my apps user table.
To do this, when they attempt to run my app, I need to read the name of the
current logged user, check to see if they are in my user table, and if not,
add them.
API: Get Login name
http://www.mvps.org/access/api/api0008.htm
When I add them, I would like to get their login name, full name,
phone, email, and AD group name to store into my user table.
Why store the data redundantly when it's in the AD? What happens if
the data changes? If you must store it in the tables for performance
reasons then the data should be read and, if required, updated every
time they enter the database.
I kept a page of notes when I was working on this topic. Below is
every link I found useful or not. Some may or may not be useful to
you.
Enumerating Local Groups and Descriptions with NetLocalGroupEnum
Pasted from
<
http://vbnet.mvps.org/code/network/netlocalgroupenumdesc.htm>
Enumerating Members of a Group with NetLocalGroupGetMembers
Pasted from
<
http://vbnet.mvps.org/code/network/netgocalgroupgetmembers.htm>
Xcacls.exe
Pasted from
<
http://support.microsoft.com/default.aspx?scid=KB;EN-US;825751>
How To Use High-Level Access Control APIs from Visual Basic
Pasted from
<
http://support.microsoft.com/default.aspx?scid=kb;EN-US;295004>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsgroup.asp
http://groups.google.ca/groups?hl=e...=off&q=adsi+search+organizationalunit&spell=1
ldap
http://msdn.microsoft.com/library/d...ry/en-us/dnanchor/html/anch_activediradsi.asp
Active Directory Service Interfaces Quick-start Tutorials
Pasted from
<
http://msdn.microsoft.com/library/en-us/adsi/adsi/adsi_quick-start_tutorials.asp?frame=true>
IADsAccessControlEntry
Pasted from
<
http://msdn.microsoft.com/library/en-us/adsi/adsi/iadsaccesscontrolentry.asp?frame=true>
An ADSI Primer, Part 11: More on Scripting Permissions and Auditing
(Windows Scripting though)
Pasted from
<
http://www.windowsitpro.com/WindowsScripting/Article/ArticleID/7456/7456.html>
Various constants are at the following:
http://www.serverwatch.com/tutorials/article.php/1476721
Security and Access Rights
http://msdn.microsoft.com/library/d...leio/base/file_security_and_access_rights.asp
Also Richard is a fellow MVP and has lots of sample code at his
website. It's VBScript but should still work reasonably well.
http://www.rlmueller.net/products.htm
ADO
Using ADO, you can use Provider=ADsDSOObject:
"Provider=ADSDSOObject;User ID=MyUserID;Password=MyPassword;"
and query using LDAP SQL:
SELECT ADsPath, cn FROM 'LDAP://OU=Sales,DC=Fabrikam,DC=COM' WHERE
objectCategory='person' AND objectClass ='user'
It is possible to bind a form to an ADO recordset, but it doesn't
always
work.
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/