Computer Name and/or IP Address

ta5
Member Posts: 1,164
Hi
How can I find out from a navision code unit on what computer (computer name, eg. xyws27) and/or its IP Address the code is currently running?
Thanks
Thomas
How can I find out from a navision code unit on what computer (computer name, eg. xyws27) and/or its IP Address the code is currently running?
Thanks
Thomas
0
Comments
-
Hi Waldo
Thanks for your post.
I have to problems:
1) I cant find the field in my 3.7 installation, it seems to be a 4.x thing?
2) On a test installation of 4.2 I see the field, but in host_name there is the name of the server, not of the client. ](*,)0 -
To find the computername you can also use
'Windows Script Host Object Model'.IWshNetwork_Class
as an automation control0 -
Also possible
Takes back the Computername where navision runs
message(environ('computername'));
Takes back the connected Client Computername from where is connect to an terminalserver (like citrix or MS Terminalserver)
message(environ('Clientname'));
Let us know, If you need the IP.
RegardsDo you make it right, it works too!0 -
Hi
Thanx for your valuable help on this.
I've tested both (WSH and environ), works like a charm =D>
Thomas0 -
garak wrote:Also possible
Takes back the Computername where navision runs
message(environ('computername'));
Takes back the connected Client Computername from where is connect to an terminalserver (like citrix or MS Terminalserver)
message(environ('Clientname'));
Let us know, If you need the IP.
Regards
OK, how about the IP?0 -
Ok, here the code for the ip.
1. create an singleinstance CU with variables to save the ip in an globel variable. Run this CU from CU 1 Company open (or your created cu). The reason for singleinst. CU is, an DOS Promp comes and users doesn't like it, ever see this promt needed variables Name DataType Subtype Length WSHShell Automation 'Windows Script Host Object Model'.WshShell WSHExec Automation 'Windows Script Host Object Model'.IWshExec WSHTxt Automation 'Windows Script Host Object Model'.TextStream FullCompName Text 80 FullCompIP Text 80 IF ISCLEAR(WSHShell) THEN CREATE(WSHShell); WSHExec := WSHShell.Exec('nslookup ' + ENVIRON('computername')); WSHTxt := WSHExec.StdOut; WSHTxt.SkipLine; WSHTxt.SkipLine; WSHTxt.SkipLine; FullCompName := COPYSTR(WSHTxt.ReadLine,1,80); FullCompIP := COPYSTR(WSHTxt.ReadLine,1,80); MESSAGE(); CLEAR(WSHShell); MESSAGE(FullCompName); MESSAGE(FullCompIP);
RegardsDo you make it right, it works too!0 -
[Topic moved from Navision forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Dear Concern
I want to know that where I have to write the following code in Navision codeunit,and following code only shows us the that client computer name not of others:
message(environ('computername'));Vikram Dabas
Navision Technical Consultant0 -
Sorry, i doesn't understand your problem.
You want to know where you can write this codesnipes?Do you make it right, it works too!0 -
Dear Concern
I want to know that where I have to write following code:
message(environ('computername'));
It means that in which codeunit I have to write above code.Suppose I m using Native DB (Local) and write code code in CU 1 in Function CompanyOpen, when I open any company then it shows me a message(means, Computer Name).And If I m using Navision SQL server then where I have to write code and how this code will be executed?Vikram Dabas
Navision Technical Consultant0 -
Hey I want to pull a report that will pull the computer name of the user how can I get this?0
-
Please check the Active Session table as this should hold the computer name of the user:
0 -
Please check the Active Session table as this should hold the computer name of the user:
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