?
Solved

Gather disk space and other info from Windows 2000 servers

Posted on 2005-04-26
22
Medium Priority
?
501 Views
Last Modified: 2008-01-09
Is there a program available that is free that I can use to gather disk space and other info from mulitiple Windows 2000 servers?  Or is there a command that I can run as a batch file?  Please help.  Thanks.
0
Comment
Question by:g000se
  • 11
  • 8
  • 2
  • +1
22 Comments
 
LVL 11

Author Comment

by:g000se
ID: 13868873
Append:  I want to run the program or command without having to log on to each server console to pull the information.
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13868902
WINMSD

And you can script a tremendous amount with batch files.
0
 
LVL 11

Author Comment

by:g000se
ID: 13869154
what is winmsd?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13869213
Windows Microsoft Diagnostics

Run WINMSD in a command prompt.  For switch info, winmsd /?

You can script it to report to a text file for every system.
0
 
LVL 9

Assisted Solution

by:kfullarton
kfullarton earned 400 total points
ID: 13869237
Check out the Microsoft script center.  There are many free scripts that can make your life easier.

http://www.microsoft.com/technet/scriptcenter/default.mspx
0
 
LVL 104

Expert Comment

by:Sembee
ID: 13869905
Check this out.
http://sydi.sourceforge.net/

You need to make sure that WMI is on the servers, but after that it makes it a breeze.

Simon.
0
 
LVL 11

Author Comment

by:g000se
ID: 13870489
Thanks for the links.  There is lots of info.  What should I keep in mind when scripting?  What is the purpose of scripting, is it like automating things or pulling information???  Would scripting benefit me in the long run as a Network Admin.?  Sorry for the bizillion questions.  
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13870760
What's the point of scripting?  Scripting automates things that otherwise would be tedious and repeatitive.  For example, I once had to WEEKLY recreate a directory structure, modify the folder permissions so only very specific people could access each folder (each folder different from the next) and backup the previous week's data.  For 100+ folders.  This would be a HUGE pain to have to do manually AND would you really want to go to work each Saturday night at midnight to do it?  I was able to script this procedure to work off a delimited text file that someone exported from excel, then scheduled a task to run every saturday at midnight.  Never had to touch it again.

Scripting if GREAT.  Any time you think you might need to do something repeatitive to one machine - or a lot of machines, it's DEFINITELY worth knowing!
0
 
LVL 11

Author Comment

by:g000se
ID: 13875602
Thanks leew. May I see a sample script you created.
0
 
LVL 11

Author Comment

by:g000se
ID: 13877172
I was viewing some sample scripts on http://www.microsoft.com/technet/scriptcenter/scripts/os/monitor/osmovb03.mspx
and I noticed that most of the sample scripts dont' support the windows 2000 environment.  Can I still tweak the script to run on the Windows 2000 environment?  I guess if there is a will there is a way to accomplish it.  I am also going to purchase the "Microsoft® Windows® Scripting Self-Paced Learning Guide".  New skills will be aquired after I am done with this stuff.
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13877227
That particular script was for a job I no longer work at.  But if you review my question history, mostly in the DOS section of this site, I have helped many people with scripts.  Even asked a question myself on a script that's fairly long.

The link you inquire about is a vbscript - nothing wrong with VB scripts, but my expertise is in batch scripting.  And MOST of the time, using various tools and utilities, you can do the same thing in a batch script you can in a vbscript using less code.
0
 
LVL 9

Assisted Solution

by:kfullarton
kfullarton earned 400 total points
ID: 13877790
Here's an example of som VBScript code that will monitor performance.  It will need to be tweaked to your configuration.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/monitoring_performance_data.asp
0
 
LVL 11

Author Comment

by:g000se
ID: 13878158
My head is spinning from the different types of scripting.  So scripting is initiated through a batch file, is there any other means?
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13878220
There is batch scripting, which is available to ALL Windows Operating Systems AND DOS (though commands and compatibilities may vary).

There is KixStart Scripting (not used much anymore from what I've seen), VbScripting, and there can be other types of scripting.  It doesn't have to start in a batch file.  

Just like there are different programming languages, there are different scripting languages/methods.
0
 
LVL 11

Author Comment

by:g000se
ID: 13878224
Thanks for all your help!
0
 
LVL 11

Author Comment

by:g000se
ID: 13878248
How would one start a VbScript?
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13878310
Use vbscripting language in a text file.  Then name the file something.VBS - the VBS should tell Windows it's a vbscript file and execute it as such.
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13878332
And you can combine things too.   You can create a batch script that uses one or more vbscripts, calling them as any other program.

And just to be clear, batch programming is using a few basic features of a command prompt (detecting errors and such) and executing commands in sequence.  These commands could be anything.  A windows program, a command line utility, another script, anything that can otherwise run on a PC.
0
 
LVL 11

Author Comment

by:g000se
ID: 13878468
It's starting to make sense now after reviewing the info listed here and online.  I created this to monitor print job status.  Here is the sample text:  
--------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set Admin = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_PrintJob")
Wscript.Echo "Print Queue, Job ID, Owner, Total Pages"
For Each objPrintJob in Admin
 strPrinter = Split(objPrintJob.Name,",",-1,1)
 Wscript.Echo strPrinter(0) & ", " & _
 objPrintJob.JobID & ", " & objPrintJob.Owner & ", " _
 & objPrintJob.TotalPages
Next

------------------

I will then add the extension .vbs to execute the script.  Can you verify this script listed above, all I did was change the name of the printer to match one on the network?   Admin is the name of the printer.  I have created batch files in the pass to assign users rights to folders on the network using xcacls.  The learning curve is getting better.
0
 
LVL 97

Accepted Solution

by:
Lee W, MVP earned 800 total points
ID: 13878569
With batch scripting, every command you can use (with a couple of otherwise minor exceptions) you can use by itself.  DIR lists the files and folders in a directory.  It can do the same thing in a batch file.  ECHO generally "prints" text to the screen.  It does the same thing in a batch file.  etc.  If there's something you can't find a built in utility to do for you, you can:
1. write one yourself, if you know how
2. find a command line program someone else wrote and use that one.  Thus adding commands is EASY.

Key to successful batch scripting is understanding the following things:

FOR
SET, Variables & environment variables
IF
ERRORLEVEL
| (Pipe)
^ (escape character when you need to use an otherwise reserved character)
> Output Redirection, >> Output redirection in append mode.
< Input Redirection

In brief:
FOR does a LOT.  Type FOR /? for additional information and help, but using for you can cycle through a numeric count (great for pinging a range of machines) or through lines of a text file, or the results of another command.

Variables are used to store information temporarily.  You name a variable almost anything you want by using the set command - SET myVar=value.  Values are then referenced by referencing the variable name surrounded by percent symbols - %myVar%.  Set can also prompt for the value and do math.  For more information on this, type SET /? in a command prompt.

Environment variables are certain things Windows sets by itself so you and other programs can always know certain important information.  Things like where the Windows directory is (found in %WINDIR%), The name of the computer (%ComputerName%), The name of the current user - %username%, and many others.  To see a list, type SET at a command prompt and hit enter.

IF is used to check if something is true or not.  "IF EXIST filename" will check if a file is there.  IF "%myVar" == "123" Echo MyVar=123 would check if "%MyVar%" variable equaled 123 and if so, "echo" (print to the screen) "MyVar=123".  There are other ways to evaluate things with if - == means equals (you must use two equals signs), NEQ means NOT equal to - for example: IF "%myVar" NEQ "123" Echo MyVar=doesn't equal 123.  Again, for more info, type IF /?

ERRORLEVEL - typically a value of 0, if you execute a command and it fails, MOST of the time, it sets the errorlevel to something other than 0 - there is a logic to this.  http://www.robvanderwoude.com/index.html seems to have a good explanation (as well as tips on scripting in batch and other types of scripts).

| (pipe) redirects output to another program.  For example, DIR will list a large directory and scroll by all at once.  If you want to pause it, one way is to say DIR | MORE - this takes the output of DIR and sends it to MORE, MORE lists things a screen at a time.  I use pipes most often in a for command piping output from one command to FIND to look for specific text.

^ Escape character - if you want to Echo something > something else - you would get an error because > means file redirection even though your just trying to say "something is greater than something else".  The way to do this is "escape" the > symbol.  This would correctly display it - echo something ^> something else.  The ^ wouldn't display in the printed statement, but you would get the desired result.

> Output redirection.  MOST command line programs output text to a part of Windows known as "Standard Output".  Standard output is usually the screen.  But if you want that output saved in a file, you can do this.  For example, DIR displays a list of directories and files.  DIR > filename.txt would return NOTHING to screen, but put the directory listing into a file called "filename.txt" - if filename.txt exists, it would OVERWRITE it, meaning erasing whatever was there.  If you said DIR >> filename.txt then it would APPEND the directory listing to that file, leaving whatever was there there, and adding the directory listing to the end of the file.

In addition, there's Standard Error.  Standard error is usually set to display on the screen as well.  You can redirect standard error by saying 2> filename.txt - 2 represents standard error (1 represents standard out, but is typically assumed if you don't say it).  One example of standard erorr and standard out usage would be:

XCOPY C:\*.* D:\ > success.txt 2>failed.txt

The above would take all successful output and save it in success.txt, then put all errors in failed.txt - easy to quickly check what failed.

< Input redirection is like output redirection.  Typically the keyboard is standard input.  But on occasion (not too often in my experience) you need to take input from something else, usually a text file.  So:

DIR /P < Filename.txt

would take the contents of filename.txt and feed it to the command DIR /P as keypresses.  This wouldn't necessarily be appropriate for the DIR command, but that's the idea.  

Again, check out http://www.robvanderwoude.com/index.html for more info on various scripting.
0
 
LVL 11

Author Comment

by:g000se
ID: 13879439
This helps.  Thanks for the clarificatioin.
0
 
LVL 11

Author Comment

by:g000se
ID: 14294304
here is my batch file I have created and it works:

REM srvinfo- Resource kit
REM srvinfo \\%1 | find "$"

REM the output from this line will be something like

REM C$      NTFS        4095       451      3644
REM D$      NTFS        7413      5411      2002

REM drive  filesys     totsize    free      used

srvinfo \\server1 | find "$"
srvinfo \\server2 | find "$"
srvinfo \\server3 | find "$"
srvinfo \\server4 | find "$"
srvinfo \\server5 | find "$"
srvinfo \\server6 | find "$"
srvinfo \\server7 | find "$"
srvinfo \\server8 | find "$"

Pause
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

609 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