This step-by-step article describes how to use the Disk Properties Query Script tool (Diskproperties.pl) to display information about disks on local and remote Microsoft Windows 2000-based computers.
The Disk Summary Script tool is available in Microsoft Windows 2000 Resource Kit Supplement 1. Use this script tool to display the disk properties of one or more computers. Diskproperties.pl can display the following information about physical disks and the volumes that they contain:
Drive letter: The drive letter that is assigned to the volume. Disk/partition number: The disk and partition number. Boot drive: Whether the volume is the system partition. Label: The volume label. Machine: The name of the computer that contains the volume. File system: The file system that is used by the volume. Compression: The compression state. Size (%): The percentage of disk space that is allocated to the volume. Free space (%): The percentage of free space on the computer that exists on the volume. Size (KB): The amount of disk space that is allocated to the volume. Free space (KB): The amount of free space that remains on the volume. Total size (KB): The size of the disk. This value is the same for all disk volumes. Total space free (KB): The total free space on all disks on the computer. Device status: The status of the volume. Location: The physical location of the volume. Manufacturer: The manufacturer of the disk. Model: The model of the disk. Media Type: The type of disk.
Some of this information corresponds to the information that is displayed in the Properties dialog box of the volume or partition when you view the volume or partition in Windows Explorer or by using Disk Management.
Diskproperties.pl runs on a source computer and acts on a target computer (which can be the same or different computer than the source computer). Before you can use this script tool to display properties of disks on local or remote computers, the following requirements must be met:
The computer is running either Windows 2000 Professional or Windows 2000 Server.
ActiveState ActivePerl Build 521 is installed. This program is available in the Microsoft Windows 2000 Resource Kit.
The computer must also be correctly configured to run the Perl scripts that are included in the Windows 2000 Resource Kit Supplement 1. The Resource Kit WMI provider module, Wmi.pm, must be in the Perl Installation Folder\Site\Lib\W2rk folder. The Resource Kit Setup program typically creates the W2rk folder and copies the Wmi.pm file to this folder.
If the W2rk folder is not automatically created during Setup, you can manually create it, and then configure the environment in which to run Diskproperties.pl. For more information about how to do this, see the "Troubleshooting" section later in this article.
You are logged on by using a user account that is a member of the Administrators group or the Server Operators group of the target computer.
The user account and the source computer must be members of the same domain or reside within trusted domains.
The parameters that you can use with Diskproperties.pl are:
Computer [ Computer ...]: Use this parameter to specify the computer or computers whose volumes you want to display by using the Computer or \\Computer format. If you specify more than one computer, separate each item with a space. Note that if you omit this parameter, the local computer is specified.
-u Domain\User: Use this parameter to specify the user account with which to run Diskproperties.pl. If you omit this parameter, Diskproperties.pl uses the permissions of the currently-logged-on user. If you use this parameter, you must also use the -p parameter to provide the user's password.
-p Password: Use this parameter to specify the password of the user account that is specified by the -u parameter. The -p parameter is required when you use the -u parameter.
-format table | list | csv: Use this parameter to specify the output format. If you omit this parameter, by default, Diskproperties.pl uses the table format.
-v: Use this parameter to add the Disk/Partition Number, Manufacturer, Model, and Media Type entries to the display when you use the list format. This parameter does not affect displays that use the table or CSV formats.
-unittype Unit: Use this parameter to specify the unit of disk space that is used to display the disk size where Unit is one of the following: B, KB, MB, GB, TB, PB. If you omit this parameter, by default, Diskproperties.pl uses KB (kilobytes).
-filter "FieldOperatorValue" [-filter "FieldOperatorValue"...]: Use this parameter to specify the criteria for disk volumes that are included in the display. If you omit this parameter, all volumes on the local computer or all volumes that are specified in the Computer [ Computer] parameter (if used) are included in the display.
To establish more than one criteria, use a separate instance of -filter "FieldOperatorValue" for each criteria that you want to specify, and then separate each instance with a space. Diskproperties.pl displays only those volumes that meet all of the criteria.
The following table lists the operators and values that are available for each field that is used with the -filter parameter, and an example of each "FieldOperatorValue":
Drive letter. The colon is optional
Disk and partition number in Dn, Pn format
yes | no
Computer name (backslashes are optional).
ntfs | fat | fat32
yes | no
= ! < >
Whole number that represents a percentage of the physical disk size.
= ! < >
Whole number that represents the percentage of free space on the computer. (Freespace\Totalfreespace)
= ! < >
NumberUnit where Number is a whole number that represents the volume size and Unit is B, KB, MB, GB, TB, or PB.
= ! < >
NumberUnit where Number is a whole number that represents the amount of free space on the volume and Unit is B, KB, MB, GB, TB, or PB.
= ! < >
NumberUnit where Number is a whole number that represents the physical disk size and Unit is B, KB, MB, GB, TB, or PB.
= ! < >
NumberUnit where Number is a whole number that represents the amount of free space on the computer and Unit is B, KB, MB, GB, TB, or PB.
To display the properties of disk volumes on the local computer using the default table format, type diskproperties.pl, and then press ENTER.
To display a detailed list of the properties of disk volumes on the local computer, type diskproperties.pl -format list -v, and then press ENTER.
To display a detailed list of the properties of disk volumes on the local computer (Server1) and on computers named Products and Marketing, type diskproperties.pl server1 products marketing -format list -v, and then press ENTER.
To display a list of volumes that have less than 500 MB of free space remaining on computers named Server1, Server7, and Server8 in table format, and direct the output to the Diskvol.txt file in the E:\Reports folder, type diskproperties.pl \\server1 \\server7 \\server8 -filter "freespace<500mb" > e:\reports\diskvol.txt, and then press ENTER.
To display a detailed list of volumes that have more than 850 MB of free disk space available and are formatted with the NTFS file system on computers named Server2 and Server3, type diskproperties.pl server2 server3 -format list -v -filter "filesys=ntfs" -filter "freespace>850mb", and then press ENTER.
To display detailed information about the system partition on a computer named Server8, type diskproperties.pl server8 -format list -v -filter "bootdrive=yes", and then press ENTER.
When you try to run Diskproperties.pl, you may receive the following error message:
ERROR: Wmi.pm is required to run the script. Copy Wmi.pm from the Resource Kit directory to /Perl/site/lib/W2RK.
This behavior can occur if the computer is not correctly configured to run the Perl scripts that are included in the Windows 2000 Resource Kit Supplement 1. To use Diskproperties.pl, the W2rk folder must exist in the Perl Installation Folder\Site\Lib folder, and it must contain the Wmi.pmi file.
To resolve this behavior, manually configure the environment in which to run Perl scripts:
Create a folder that is named W2rk in the Perl Installation Folder\Site\Lib folder.
NOTE: The default Perl Installation Folder is drive:\Perl, where drive is the drive on which Windows is installed.
Copy the Wmi.pmi file from the folder in which the Windows 2000 Resource Kit is installed (by default, \Program Files\Resource Kit) to the W2rk folder that you created in step 1.
When you use Diskproperties.pl, you may receive the following message in the display:
INFO: No Information available after filter operation.
This behavior may occur if Diskproperties.pl does not find any volumes that meet the filter criteria that you specified. You can interpret this message as a "not found" notification.