Microsoft KB Archive/318762

= HOW TO: Use the Disk Properties Query Script Tool (Diskproperties.pl) in Microsoft Windows 2000 =

Article ID: 318762

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q318762





IN THIS TASK
SUMMARY System Requirements for Diskproperties.pl
 * Source Computer
 * Target Computer

Overview of Diskproperties.pl Examples Troubleshooting REFERENCES



SUMMARY
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.

back to the top

System Requirements for Diskproperties.pl
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:

back to the top

Source Computer

 * 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 \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 &quot;Troubleshooting&quot; 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.

back to the top

Target Computer

 * The computer is running either Windows 2000 Professional or Windows 2000 Server.

back to the top

Overview of Diskproperties.pl
Diskproperties.pl uses the following syntax:

diskproperties.pl [  ...][ -u  -p  ][ -format table | list | csv ] [ -v ][ -unittype  ][ -filter [ -filter ...]]

The parameters that you can use with Diskproperties.pl are:
 *   [   ...]: Use this parameter to specify the computer or computers whose volumes you want to display by using the   or \\  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 : 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 : 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 : Use this parameter to specify the unit of disk space that is used to display the disk size where   is one of the following: B, KB, MB, GB, TB, PB. If you omit this parameter, by default, Diskproperties.pl uses KB (kilobytes).
 * -filter  [-filter ...]: 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   [  ] parameter (if used) are included in the display.

To establish more than one criteria, use a separate instance of -filter  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 :

back to the top

Examples

 * 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 &quot;freespace<500mb&quot; > 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 &quot;filesys=ntfs&quot; -filter &quot;freespace>850mb&quot;, 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 &quot;bootdrive=yes&quot;, and then press ENTER.

back to the top

Troubleshooting
 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 \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 \Site\Lib folder.

NOTE: The default  is  :\Perl, where   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 &quot;not found&quot; notification.

back to the top

<div class="references_section">