inventory of mounted drives (which class?)

S

Steven Platt

I am trying to inventory all the drives that my workstations have mounted at
the present time. What class do I need to be looking at? Or is there a way
to do this with WScript.Network? Any comments are appreciated.

-Steven-
 
S

Scott McNairy \(MVP\)

You will want to take a look at the Win32_LogicalDisk class for this, note
that you may want to limit it down to instances with drivetype = 3 (local
drives only), you can do this by using the ExecQuery call with this query.

select * from win32_logicaldisk where driveType = 3
 
S

Steven Platt

I found a class on google called Win32_MountPoint. That only works for
Windows 2003. And then I found a class(Win32_MappedLogicalDisk) that lists
all the mounted drives that works on 2003 and XP but not on 2000. I have XP
and 2000 on all of my workstations. I would really like to see where these
MappedLogicalDisk's are pointed to. Does anyone know a way around this for
XP and 2000? Please help me, I am trying to redo AD/Logon scripts. The way
it is setup now is with Kixtart. I really don't want to manually inventory
all the computers in this office(32 of them).

-Steven-
 
S

Scott McNairy \(MVP\)

Oh, Mapped Logical Disks, if you need to see where they are pointed to can
be returned by this query against Win32_LogicalDisk, Win32_MappedLogicalDisk
doesn't give you the location pointed to, Win32_LogicalDisk exposes this
information in the ProviderName property.

select * from win32_logicaldisk where driveType = 4

instance of Win32_LogicalDisk
{
Caption = "Z:";
Compressed = FALSE;
CreationClassName = "Win32_LogicalDisk";
Description = "Network Connection";
DeviceID = "Z:";
DriveType = 4;
FileSystem = "NTFS";
FreeSpace = "36341739520";
MaximumComponentLength = 255;
MediaType = 0;
Name = "Z:";
ProviderName = "\\\\products\\public";
Size = "36413280256";
SupportsDiskQuotas = TRUE;
SupportsFileBasedCompression = TRUE;
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "SCOTTSLAPTOP";
VolumeName = "D_Drive";
VolumeSerialNumber = "16C02CE8";
};
 
S

Steven Platt

You are a lifesaver, thanks Scott.

-Steven-
Scott McNairy (MVP) said:
Oh, Mapped Logical Disks, if you need to see where they are pointed to can
be returned by this query against Win32_LogicalDisk,
Win32_MappedLogicalDisk doesn't give you the location pointed to,
Win32_LogicalDisk exposes this information in the ProviderName property.

select * from win32_logicaldisk where driveType = 4

instance of Win32_LogicalDisk
{
Caption = "Z:";
Compressed = FALSE;
CreationClassName = "Win32_LogicalDisk";
Description = "Network Connection";
DeviceID = "Z:";
DriveType = 4;
FileSystem = "NTFS";
FreeSpace = "36341739520";
MaximumComponentLength = 255;
MediaType = 0;
Name = "Z:";
ProviderName = "\\\\products\\public";
Size = "36413280256";
SupportsDiskQuotas = TRUE;
SupportsFileBasedCompression = TRUE;
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "SCOTTSLAPTOP";
VolumeName = "D_Drive";
VolumeSerialNumber = "16C02CE8";
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top