Link to home
Start Free TrialLog in
Avatar of japji
japji

asked on

Basic Script to extract System Drive Available disk space on REMOTE SERVERS

Hi Guys,

I need a script which could do the following:

- Take Server Names from a Text File (Approx 2000+ Servers),
- Check the Total Space and Available Space only on C Drive
- Extract the results in CSV in a nice format.

Thank you.
Avatar of Bill Prew
Bill Prew

You can do this with a single line right at a command prompt (or in a bat file).  Give this a try and see if it does what you are looking for:

wmic /node:@"computers.txt" LogicalDisk Where "DeviceID='C:'" Get DeviceID,FreeSpace,Size /Format:csv>"report.csv"

Open in new window

~bp
Avatar of japji

ASKER

Hi BP,

The command works like a charm... however I would request you to just modify it slightly as below:

1. Prepare a Batch File
2. The Free Space and Size should spit the results either in MB or GB.

Thanks mate.
You should be able to use my script here:
https://www.experts-exchange.com/A_4379.html

to do the job.

Regards,

Rob.
Avatar of japji

ASKER

Hi Rob,

The script actually works perfectly fine however and it lists the Available Space on C Drive.

However my requirement is to extract the Total Space and Available Space.

Any chance you could modify the script please.

thanks mate.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of japji

ASKER

Fantastic Solution Rob.

Cheers mate.
Avatar of japji

ASKER

Fantastic Solution Rob.

Cheers mate.
Great!  Thanks for the grade.

Rob.