Personally I think this should be the responsibility of your monitoring system that monitors your servers. If you're using a SAN then this should be part of their management tools. However if you are not setup for that scenario then getting the disk space and reporting errors is reasonable.
The challenge with network shares is the data may not be 100% reliable in my experience, although things could have changed. A network share hosted on a file server may not report the actual size of the allocated drive, for security reasons or whatever nor may it actually show what is really remaining on the share. Quotas can complicate this as well because a quota limit might say you have 100MB left whereas the drive itself has plenty of space. But let's assume you're using a simple NAS that does report the size and policies aren't getting in the way.
The easiest approach is to create a Powershell script that retrieves the data. You can then send an email or some other alert if the share goes below a certain level. If it were a logical drive then Get-PSDrive works. But mapped drives are per-user and relies on persistence which you probably don't want to deal with so instead you'll likely need to use UNC. However you can create a PS session temporary mapped drive to make it work using New-PSDrive.
$drive = New-PSDrive -Name ShareCheck -PSProvider "FileSystem" -Root "\\server\share"
But it may or may not return the space correctly as mentioned earlier. There is one SO post that mentions that New-PSDrive
doesn't return space information irrelevant but using the old net use
command does work when used in combination with Get-PSDrive
.
net use 'X:' '\\server\share' /persistent:no
$drive = Get-PSDrive 'X'
Note: You should the mapping when done.
WMI used to work but more recent PS versions don't seem to work quite as well. That would be an alternative if the NAS supports it.
To get this to run set up a Scheduled Task in Windows to run as frequently as you want. Have it run your Powershell script whether anyone is logged in or not and you should be good to go. Note that you'll need to ensure the scheduled task is executed using an account that has appropriate access to the UNC path you are checking.