Active Directory and Navision 4.0

Hilde
Member Posts: 3
Does anybody know how to retrieve information from AD into a report?
In SQL2005 we work with groups in stead of usernames and I need to retrieve employee.no.
I tried with an ODBC connection but I can not get it to work.
CREATE(ADOcnn);
CnnStr := 'PROVIDER=ADsDSOObject';
ADOcnn.Open(CnnStr);
CREATE(ADOrst)
strSQL := 'SELECT ADsPath FROM 'LDAP://dc=domain,dc=nl'';
ADOrst.Open(strSQL,ADOcnn)
Thanks in advance.
In SQL2005 we work with groups in stead of usernames and I need to retrieve employee.no.
I tried with an ODBC connection but I can not get it to work.
CREATE(ADOcnn);
CnnStr := 'PROVIDER=ADsDSOObject';
ADOcnn.Open(CnnStr);
CREATE(ADOrst)
strSQL := 'SELECT ADsPath FROM 'LDAP://dc=domain,dc=nl'';
ADOrst.Open(strSQL,ADOcnn)
Thanks in advance.
0
Comments
-
1) What does it mean "n SQL2005 we work with groups in stead of usernames"? It is not clear for me...
2) Take a look at virtual tables 2000000050..2000000056. I think that it is what you need.0 -
We used to login with our windows username. Now we belong to a group and you see the groupname in de usersetup.
I just want to be able to talk to the active directory in stead.
Do you know how?
Hilde0 -
Once again:
2) Take a look at virtual tables 2000000050..2000000056. I think that it is what you need.0 -
Ok long time ago this mail, but to continue.
In the 2000050 you have all the ad users/groups etc...
Can anyone point me in the direction on how to proceed from there to pe. change the phone number in the AD for a particular user..
Object is to update from employee card certain data in the ad, so we don't have to put them in twice....
Rgds
BennyRgds
Benny Giebens0 -
You cannot change the data in AD from NAV.
1) he user will need to have permissions on AD to do that
2) You can use some automation to do that, but not through Virtual tables.0 -
1) permissions is not a problem.
2) i know i need to use automation, the problems is what controls, and how to use them......so if someone has some code expamples it would be very helpfull!!Rgds
Benny Giebens0 -
BGI wrote:1) permissions is not a problem.
2) i know i need to use automation, the problems is what controls, and how to use them......so if someone has some code expamples it would be very helpfull!!
i didn't search which automation can be used in Nav but i think you can use this solution simply:
1. here is my vb code that i used 4 years ago to update objects in ad.Set objUser = GetObject("LDAP://CN=" & "DisplayName of user" & ",OU=" & "OrganizationalUnit of user" & ",dc=xxxx,dc=xxx,dc=edu,dc=tr") objUser.Put "pwdLastSet", -1 intUAC = objUser.Get("userAccountControl") objUser.Put "userAccountControl", intUAC XOR ADS_UF_DONT_EXPIRE_PASSWD objUser.AccountExpirationDate = "01/01/1970" objUser.AccountDisabled = FALSE objUser.SetInfo objUser.SetPassword "PassWord" set ObjUser = Nothing
2. change above code lines because it should take parameters from command line.(i am supposing that you are familiar with vbscript)
3. save the above code into a .vbs file.
4. call cscript.exe or wscript.exe to run that vbs file from Navision with parameters..(you can use "windows scrpting host object".wshshell).
google will give you lots of examples of vb scripts to do that.
also you can save the vb codes as txt files, not vbs files. cscript.exe or wscript.exe will run them properly..
hope this help..0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions