Get Local IP address from NAV 2013 R2

navuser1
Member Posts: 1,334
Dear all,
How to get the IP Addresses of the (RTC) Client Machines who is accessing the NAV SERVER ?
Regards,
Navuser1
How to get the IP Addresses of the (RTC) Client Machines who is accessing the NAV SERVER ?
Regards,
Navuser1
Now or Never
0
Answers
-
0
-
Hello,
You can try this code
ActiveSession.GET(SERVICEINSTANCEID, SESSIONID);
IPAddresses:= IPAddresses.List;
IPAddresses.AddRange(Dns.GetHostAddresses(ActiveSession."Client Computer Name"));
FOR i := 0 TO IPAddresses.Count - 1 DO BEGIN
MESSAGE('%1', IPAddresses.Item(i));
END;
Where variables:
P.S: the client machine may have more than one IP address.0 -
I forgot to mention that you may need to adapt the code. It works for NAV 2016. I did not tested it for NAV 2013 R20
-
Few Local Machines are using RDP for accessing the NAV DB, I need to know their the Local IP address.
Is it possible ?Now or Never0 -
Possible...well maybe technically. But you would have to get the client session (RDP session) to ask Windows (netstat or something more modern?) to give you the remote ip address. Sounds like adding a lot of error-prone complexity to me.1
-
Few Local Machines are using RDP for accessing the NAV DB, I need to know their the Local IP address.
Is it possible ?
Hi navuser1,
1- you should give feedback if the suggested solutions worked or not.
2- it is not too difficult to say "thank you" to people who are trying to help you.
3- you're asking a second question that is different from the first one.
In another note, as suggested by EvR, you may use netstat and try to find the IP address through TCP port 3389 if default. Otherwise you should look for port value in registry key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
Another suggestion is to use the "Remote Desktop Services API reference".0 -
Thank you for your help.
Now or Never0 -
Hi, NavNab
I am unable to create a variable of DotNet type for Dns.
I didn't find Dns class there.
Please help me......0 -
Hello @tabrezajaz@hotmail.com
And you can download the object "COD92600_Get Local IP.txt"
P.S: delete ".jpg" to get the correct object extension.1 -
Hi @omerfaruk
The topic is dated, but if memory serves, you should opt for RunOnClient ๐
My memory of .NET specifics is fuzzy at the moment. RunOnClient likely won't function on a web client due to .NET restrictions.
Could you try it out and report back? ๐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