viewpoint-particle

Author Topic: Figuring Out Users Common Name  (Read 5757 times)

geauga

  • Newbie
  • *
  • Posts: 29
Figuring Out Users Common Name
« on: December 28, 2015, 06:53:49 am »
I am using wntUserInfo to determine a users username.  I now need to determine whether they are a member of an AD group.  I have tried using the ADSI extender to build a LDAP query to no avail.  Any suggestions?

td

  • Tech Support
  • *****
  • Posts: 4381
    • WinBatch
Re: Figuring Out Users Common Name
« Reply #1 on: December 29, 2015, 07:46:49 am »
You can use the ADSI extender to easily check group membership using the dsIsMemberGrp function.  Common problems include incorrect user or group path, or  insufficient privileges.   You do know how to use the dsFindPath function to obtain the full LDAP path of a user from the sAMAcountName returned by wntUserInfo?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

  • Sr. Member
  • ****
  • Posts: 432
Re: Figuring Out Users Common Name
« Reply #2 on: December 29, 2015, 09:14:49 am »
It most definitely needs to be done via ADSI, either using the ADSI extender, or using the ADSI COM interfaces.  The NT extender simply does not have access to that information via the Win32 API functions that access AD through the legacy SAM database interfaces.