• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

System Information Script

I am looking for a script that I can run on mulitple servers and capture the following:

System Name
CPU Info
Memory
Drive Info - Size - Free - Used

After capturing it I would like for this information be written to a .txt file.

I know trhat I can use SRVINFO from the Resource Kit, but that returns entirely too much information.
0
bnorrisatnortechsolutions
Asked:
bnorrisatnortechsolutions
  • 5
  • 4
  • 3
  • +2
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
You should be able to use WMIC to obtain this information (I've done it with Disk space and I'm sure it's supports the other requests.

However, I find the Technician version of System Information for Windows to be ideal for this kind of thing.  While not free, it's inexpensive and runs as a single executable.  In conjunction with PSEXEC, you can run it against all servers (or workstations) in a Windows network and get TONS of information - or you can grab JUST the categories you want using command line options.  

I used SIW (www.gtopala.com) to query all workstations at one client and create CSV files of all configs then I used a simple find command on the command line to detail the RAM in each system (and when I say detail, I mean DETAIL - it told me the make/model of the RAM as well as the capacity of each module and how many modules were installed and how many slots that machine had.  Using this information, I was able to quickly determine what kinds of upgrades were necessary to maintain dual-channel support in all workstations while bringing all workstations up to 4 GB of RAM each.
0
 
Aaron TomoskyTechnology ConsultantCommented:
Get the pstools from sysinternals (kinda part of Microsoft). One of those can do it. Don't remember the name ATM
0
 
ReneGeCommented:
Here is a very simplistic batch file:

Note that "/format:csv" does may not work on W7.

@ECHO OFF
SET Output=Output.txt
wmic logicaldisk where drivetype=3 get Name,Size,FreeSpace /format:csv>%Output%
wmic os get BuildNumber, BuildType, Version /format:csv>>%Output%
wmic cpu get Name>>%Output%
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
Bill PrewCommented:
Do you want to run a script on a single central computer and have it query each of the servers remotely, or are you looking for something that you can run on each server locally.

~bp
0
 
bnorrisatnortechsolutionsAuthor Commented:
I am looknig for something that I can put a list of server names in and have the script run against that and return it's results to a txt file.
0
 
ReneGeCommented:
Here a modified version of my idea.

It is most likely "challanged" but I'm to tired to unbug it.

Cheers,
Rene

PS: hey ~bp

@ECHO OFF

SET Server.1=DomainController1
SET Server.2=webserver
SET Server.3=mysqlserver

FOR /F "tokens=2 delims==" %%A IN ('SET Server.') DO (
	wmic /node:%%A logicaldisk where drivetype=3 get Name,Size,FreeSpace /format:csv>"%%A.txt"
	wmic /node:%%A os get BuildNumber, BuildType, Version /format:csv>>"%%A.txt"
	wmic /node:%%A cpu get Name>>"%%A.txt"
)

Open in new window

0
 
bnorrisatnortechsolutionsAuthor Commented:
Found my own solution.  Thank yuo all for your assistance.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
And you don't want to share it with the rest of us?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Just preventing auto-close - I object until I know what the solution was.  I gave my time freely to this person and received no feedback to my comment, so I want to know what his solution was before I accept that I wasted my time.
0
 
ReneGeCommented:
Totally agree with leew
0
 
bnorrisatnortechsolutionsAuthor Commented:
Sorry guys -

get-wmiobject -query "SELECT SystemName,Caption,VolumeName,Size,Freespace FROM win32_logicaldisk" -computer (get-content "C:\servers.txt") |

Select-Object SystemName,Caption,VolumeName,@{Name="Size(GB)"; Expression={"{0:N2}" -f ($_.Size/1GB)}},@{Name="Freespace(GB)"; Expression={"{0:N2}" -f ($_.Freespace/1GB)}}|

export-csv -path "C:\DiskSpace.csv" -NoTypeInformation

I am willing to offer some points for your time as I don't want you all to feel that I am not appreciative.  I just didn't know that I could if I didn't use your solution.  I again apologize.
 
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
So it looks like you used a PowerShell script and WMI... In a sense, what I suggested at first - "You should be able to use WMIC to obtain this information" - the difference being that WMIC is for the command line vs. powershell command line.

Just so we're clear.
0
 
ReneGeCommented:
@ModCorlEEone
It was me that stated "Totally agree with leew" not "bnorrisatnortechsolutions".

@All
I'm just curious why someone would hesitate to just split the totallity of the offered points. The solutions proposed are often elements of reflections to find the finnal solution and it does not cost him/her anything and demonstrats gratitude for the efforts of helping hands.

I'd like to have your input on this, cause I've seen this few times to often and I find this to be confusing.

Thanks,
Rene
0
 
ReneGeCommented:
@bnorrisatnortechsolutions

I just want to sure my question on my previous post not targetted to you. Maybe I'm missing something and in fact, It does cost something, like some points of the question originator or I don't know.

Cheers,
Rene
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now