Mapped Drive Freespace Conundrum

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
IanUoY
Posts: 90
Last visit: Mon Mar 22, 2021 7:21 am

Mapped Drive Freespace Conundrum

Post by IanUoY »

I can quite easily extract freespace of any mapped drives where the mapped drive is \\server\sharename. However, the particular drives I want to report on is mapped as \\server\sharename\dirname

In this case the size is fine using eg

Get-WMIObject Win32_LogicalDisk -filter "DeviceID='P:'"

However, the freespace reported is the size of the top level share by the looks of it, as it is massively more than the total size of the drive.

Unfortunately we are running Windows Server 2008 R2 and so cannot use the new fsrm cmdlets in Server 2012.

I did notice though that Windows Explorer correctly displays the freespace, which I assume it gets by looking at the quota.

So, my question - can I access the servers quota's remotely or is there a way of grabbing the information as show in Windows Explorer.

Regards

Ian

Locked