|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 2:20 PM
Points: 360,
Visits: 1,085
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, September 28, 2012 9:00 AM
Points: 11,
Visits: 156
|
|
Hi all!
I suggest a little add on to this 'IP-script' as follows:
OR upper (ipLine) like '%IPv4 ADDRESS%'
Cheers, Bertil F
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, March 25, 2013 8:37 AM
Points: 163,
Visits: 275
|
|
If you're running SQL Server 2005 or above you can use this (some shops disable xp_cmdshell):
Select client_net_address,local_net_address from sys.dm_exec_connections where session_id=@@SPId;
Limitation: You only get IP addresses if you're connective via TCP/IP. If you're local and using Shared Memory then those attributes don't exist. If you turn off Shared Memory (or any protocols except for TCP/IP) via Server Configuration Manager you will always get IP address for any connection using this technique.
PeteK I have CDO. It's like OCD but all the letters are in alphabetical order... as they should be.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 2:20 PM
Points: 360,
Visits: 1,085
|
|
Awesome!Thanks!
¤ §unshine ¤
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 1:51 PM
Points: 1,825,
Visits: 257
|
|
Select client_net_address,local_net_address from sys.dm_exec_connections where session_id=@@SPId;
- This works Yours does not on our cluster evironment (NULL)
create table #temp (ipLine varchar(200)) insert #temp exec master..xp_cmdshell 'ipconfig'
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 280,
Visits: 1,029
|
|
Hi How i can get all remote servers IP add and host name ? you have any updated script?
Aim to inspire rather than to teach. SQL Server DBA
|
|
|
|