Query to get IP address ,DomainName,OS_version for Server

  • Hi any query for getting IP address ,DomainName,OS_version for Server and

    query for getting Instance_nm,Dbms_version,Port_number for all the instances running on that server .

    Thanks in advance

  • You'll be able to get all of that through a CLR function/proc. Is that an option for you?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • master..xp_cmdshell 'ipconfig'

    GO

    SELECT SERVERPROPERTY('ProductVersion') AS 'ProductVersion'

    GO

    DECLARE @chvDomainName NVARCHAR(100)

    EXEC master.dbo.xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon', N'CachePrimaryDomain',@chvDomainName OUTPUT

    SELECT @chvDomainName AS DomainName

    GO

    DECLARE @tcp_port nvarchar(5)

    EXEC xp_regread

    @rootkey = 'HKEY_LOCAL_MACHINE',

    @key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',

    @value_name = 'TcpPort',

    @value = @tcp_port OUTPUT

    select @tcp_port AS Port_Number

    GO

    master..xp_cmdshell 'SQLCMD -L'

  • I would probably do this in SSIS with a WMI query..

    CEWII

  • Hi can you please provide me with WMI query to get the Server Name, instance names, IP address,OS_version,Dbms_version,Domain,Portnumbers for each instance

    Thanks in advance

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply