Solved

Script to Get Server Info

Posted on 2008-06-16
5
208 Views
Last Modified: 2013-11-26
Does anyone know of a script that I can run that will go to a specific server on my network and return the

1. Operating System
2. Disks and space left on them
3. SQL Server Version
4. Memory and type
0
Comment
Question by:computerstreber
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:DocCan11
ID: 21798270
The best choice for this is to use WMI.. it will provide the information you need.
0
 
LVL 6

Expert Comment

by:DocCan11
ID: 21798280
0
 
LVL 8

Accepted Solution

by:
sbagireddi earned 500 total points
ID: 21798327
these may help:


-- Server Info
SELECT  CAST( SERVERPROPERTY( 'MachineName' ) AS varchar( 30 ) ) AS MachineName ,
        CAST( SERVERPROPERTY( 'InstanceName' ) AS varchar( 30 ) ) AS Instance ,
        CAST( SERVERPROPERTY( 'ProductVersion' ) AS varchar( 30 ) ) AS ProductVersion ,
        CAST( SERVERPROPERTY( 'ProductLevel' )  AS varchar( 30 ) ) AS ProductLevel ,
        CAST( SERVERPROPERTY( 'Edition' ) AS varchar( 30 ) ) AS Edition ,
       ( CASE SERVERPROPERTY( 'EngineEdition')
            WHEN 1 THEN 'Personal or Desktop'
            WHEN 2 THEN 'Standard'
            WHEN 3 THEN 'Enterprise'
       END ) AS EngineType ,
       CAST( SERVERPROPERTY( 'LicenseType' ) AS varchar( 30 ) ) AS LicenseType ,
         SERVERPROPERTY( 'NumLicenses' ) AS #Licenses;


-- Drive Space
EXEC master..xp_fixeddrives
0
 
LVL 3

Author Comment

by:computerstreber
ID: 21808048
sbagireddi, your answer is reall good. Is there a way to include the OS on the server and memory; type and amount? I looked up the syntax for SERVERPROPERTY and I did not see anything related to those.  
0
 
LVL 8

Expert Comment

by:sbagireddi
ID: 21835130
I do not think that any of the system tables in SQL server carry information pertaining to the OS of the server.
Again I may be wrong.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now