but I’m getting an error " A singular expression is required." I assume thats because I’m getting multiple responses from servers.
You are correct. This is because of the plural “drives” in your relevance clause. It will return the size of every drive on the system, which cannot be evaluated through an if statement. There are several ways that I can think of at the moment that will fix this and there may be other solutions as well.
If you want to check the drive space of a particular drive (with a letter):
if ((((free space of it / total space of it as floating point) * 100) < 20) of drive “C:” whose (type of it = “DRIVE_FIXED”) ) then (“True”) else (“False”)
If you want to check the drive space of the SYSTEM drive (since it’s not necessarily “C:” on every machine):
if ((((free space of it / total space of it as floating point) * 100) < 20) of (drive of system folder) whose (type of it = “DRIVE_FIXED”) ) then (“True”) else (“False”)
If you want to return all drive letters that have less than x space, you could eliminate the IF statement and just return a list of drives with less than 20% free space:
names of drives whose ((type of it = “DRIVE_FIXED”) and ((free space of it / total space of it as floating point ) * 100 < 20))