Use T-SQL to return free space on a network share I'd like to be able to calculate the amount of free space I have for offsite backups so I can prevent any jobs from running should there not be the relevant space and also be able to send alerts when required. I'm aware of using cmd command FSUTIL (as below) for local drives however this doesn't seem to work for network drives.  Please can an alternative be suggested?
Thanks in advance.

exec xp_cmdshell 'FSUTIL VOLUME DISKFREE c:\'
I'm not sure if this will give you exactly what you want, but you could try this:

DECLARE @cmd VARCHAR(2000)
SET @cmd = 'DIR "\\SHARENAME"'

EXEC xp_cmdshell @cmd


The last line would give you the freespace

output
04/04/2016  05:39 AM            15,872 TrackSqlLogins_0_131042360126710000.xel
08/15/2014  07:01 AM               449 TransparentDataEncryptionCertificate
08/15/2014  07:01 AM               636 TransparentDataEncryptionCertificatePrivateKey
              13 File(s)  1,208,231,169 bytes
               8 Dir(s)  217,800,073,216 bytes free