Access Active Directory Users by Code

maheshmahesh Member Posts: 115
Dear NAV experts,

I want all Active Directory users in one form run time basis. I already read active directory related posts.
User SID or SID - Account ID virtual table also doesn't have required data. Windows Login table also contains list of only users which are added in NAV.

I want screen similar to "Windows Users & Groups" which is accessible from Tools->Security->Windows Login and Lookup in ID column.

Any ideas?

Mahesh Jain
Best Regards,
Mahesh Jain
mahesh@reliconservices.com

Comments

  • BernardJBernardJ Member Posts: 57
    Maybe you need Windows Object? Record 2000000050
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    If your database is on SQL, you could create a linked server ADSI (Active Directory Service Interface) on SQL Server. Then you can query Active Directory through a SELECT statement. In NAV, you can use ADO to execute SQL statements from C/SIDE.

    I don't have any ready-made code available. Search the web for "adsi linked server sql". Search mibuso.com forum for "ado sql".
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • maheshmahesh Member Posts: 115
    Thanks Bernad & Luc Van Dyck for perfect reply.
    I tried Barnad's solution by using "Windows Object" virtual table. This is what i needed..! I could access all Active Directory users in one form & use for futher processing.

    Sad news is that It is not working in RTC.
    I get error - "Internal error 12 in module 40. Contact your system administrator or partner."

    I also wrote a code to transfer these records in another physical table of NAV & tried to display but System gives error when accessing "Windows Object" table itself. Any idea.. :idea:
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • BernardJBernardJ Member Posts: 57
    Sorry, only know about Nav5.
    But maybe it's something to do with the PC where NAV is running? (whether it's client or not)
    See http://msdn.microsoft.com/en-us/library/dd301309.aspx
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello,

    Thanks for putting this post.
    I am also facing the same issue while accessing the USERNAME calculated from Classic and using it into RTC.

    Classic works fine. But, RTC giving the same error that you have mentioned.

    Could you please, suggest me what can be the solution to get it worked into RTC Report?

    Thanks.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.