Kalny Posted September 18, 2014 Posted September 18, 2014 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!
fairm010 Posted September 18, 2014 Posted September 18, 2014 Why re-invent the wheel? Call this app at login with a login script. (edit the settings.ini first) [ATTACH]26445[/ATTACH]
HPlum78 Posted November 17, 2016 Posted November 17, 2016 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.
HPlum78 Posted November 18, 2016 Posted November 18, 2016 Now I have had a bit of a poke around there is a Win32_QuotaSetting class maybe that would do you.
evasion Posted November 18, 2016 Posted November 18, 2016 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now