WMIC to create a report of free disk space on servers

To see the free space on drives for a server, use the following command.
NOTE:  Replace   with the name of your server.

C:\temp>wmic /AGGREGATE:Off /FAILFAST:On /RECORD:outout.xml /NODE: "" logicaldisk get SystemName,description,DeviceID,FreeSpace
Description              DeviceID  FreeSpace    SystemName
3 1/2 Inch Floppy Drive  A:                     DEN01VMDBSOLO01
Local Fixed Disk         C:        12263886848  DEN01VMDBSOLO01
Local Fixed Disk         D:        78583287808  DEN01VMDBSOLO01
Local Fixed Disk         E:        78348578816  DEN01VMDBSOLO01
CD-ROM Disc              F:                     DEN01VMDBSOLO01
Network Connection       R:        52428800000  DEN01VMDBSOLO01

Even better, you can do so for a whole list of servers, by
A) Creating a comma delimited or newline delimited (on server on each line) list of server names in a .txt file.

B) Replacing with @ServerList.txt, where ServerList.txt is the name of your text file.



Popular posts from this blog

Detecting Transaction Isolation Level through Profiler Trace and other means on MS SQL Server 2005

Regular Expressions in SQL Server, DB2 UDB, and Oracle