Fetch shared storage usage info from windows server.
I am trying to retrieve usage related info of shared storage attached to a server by using:
WMIC logicaldisk get size,freespace,caption,drivetype /Format:csv

The output is fine. But here the Drive type for drive-D is showing as 3, though its a Netapp Lun. Please let me know how to get Lun information. Its becomes tough for me to identify a Netapp volume if it is showing Netapp as Drivetype 3.
I do not have powershell installed in all the servers.So i can not use PS.

OUTPUT:
Node,Caption,DriveType,FreeSpace,Size
Hostname,C:,3,1522081792,20973137920
Hostname,D:,3,38534803456,751148986368
Hostname,E:,3,2867924992,52395274240
Hostname,F:,3,44005818368,73364254720
Hostname,R:,5,,
March 27th, 2015 3:13am

Win32_LogicalDisk does not appear to have a way of differentiating an iSCSI drive from a directly attached storage drive.

However, it looks like Win32_DiskDrive might have this information on the Model property.

According to this script http://stackoverflow.com/questions/13485666/foreach-drive-letter-array, Win32_DiskDrive Model should contain "iSCSI" for iSCSI drives, so you can just compare against that.

Let us know if that helps,

Fausto

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2015 6:10am

This looks like powershell.  I do not have powershell installed on all the servers.
I need some bat/cmd script.

Thank You


March 27th, 2015 7:31am

This looks like powershell.  I do not have powershell installed on all the servers.
I need some bat/cmd script.

Thank You

You can query WMI using VBScript or WMIC.

Also, you don't need PowerShell installed on the servers to use PowerShell to gather information. PowerShell can do this remotely.

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2015 8:51am

The link I gave you was not meant to be a exact copy/paste of what you should run, it was just so you could see that someone else managed to determine whether a particular volume was an iSCSI drive or not by using WMI to query the Win32_DiskDrive class and look at the Model property.

In their case, as you can see from the link I posted (regardless of the language used), the Model property had a value of "iSCSI" when it was an iSCSI drive.

How you use this information is completely up to you: batch/VBScript/PowerShell/C#, whatever. I'm just pointing out what WMI classes to query and what values to compare against.

You're already using WMIC, so just continue using that if you're more comfortable with it.

March 27th, 2015 9:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics