Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Display shared drive quota in POWERSHELL

$
0
0

I've been googling this for hours and can't find anything that's actually working.

I'm trying to use powershell to report the quota limit/size of a shared drive. My query code is:

$DiskSize = Get-WmiObject Win32_Mappedlogicaldisk -Filter "DeviceID='N:'" | Select Size | Out-String
$FreeSpace = Get-WmiObject Win32_Mappedlogicaldisk -Filter "DeviceID='N:'" | Select FreeSpace

Problem is, $FreeSpace is reporting the physical drive space (2TB~) and not the quota size of 500mb. Our quotas change constantly so giving $disksize a value of 500 won't work as it won't reflect changes made on the server.


Viewing all articles
Browse latest Browse all 21975


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>