Jump to content

Powershell - Get quota size


Recommended Posts

Posted

I'm trying to write a powershell script that will give me the free space of a network drive with a quota.

 

So far I've got:

 

$FreeSpace = Get-WmiObject Win32_logicaldisk -Filter "DeviceID='N:'" | Select FreeSpace

 

But this returns the literal free space of the drive (in this case, 2TB) instead of showing me the quota (500mb) - Normally this wouldn't be an issue but our student quotas change frequently so we would need something to perform a lookup before doing percentage calculations.

 

This script is intended to run as the logged on user.

 

Any help with this would be greatly appreciated!

  • 2 years later...
Posted
Not sure that WMI has any hooks into the quota subsystem, I think it's part of FSRM so unless all your workstations have RSAT installed running a logon script at logon would not work so well, and also a little pointless as you would do your quota reporting server side I would imagine. Anyhow I think it's get-fsrmquota in fact look here https://technet.microsoft.com/en-us/library/jj900651.aspx I think there are OS dependencies mind.
Posted
not sure if that would work at all, so tried kixtart login script as provided on their wiki page. Needless to say it is unable to report diskspace via the function provided, though it would be nice to have that with win7 clients having user space on 2012R2 fileservers.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...