Network folder free space not displaying on iis

Im trying to get the amount of freespace for servers in a dropdown list

It works fine locally but the freespace variable value doesnt display on dashboard running on iis

Ive tried using content and endpoints

Any ideas?

Code snip below



$session:nwobj=new-object -comobject WScript.Network

$session:drive=get-psdrive U






$session:freespace1 = $session:freewithoutdecimal | Out-String

$session:freespace1 = $session:freespace1 + “% Free”


net use u: /delete



new-udelement -tag “div”-Id “cidrivediv” -Endpoint{

New-UDSelect -Id “ciselect” -option {

New-UDSelectOption -Name “Select Server” -Value “Select Server”

New-UDSelectOption -Name “\server1\share1 $session:freespace1” -Value “\server1\share1”

} -OnChange{

$session:idservsel = (Get-UDElement -Id ciselect).attributes[“value”]


Set-UDElement -Id outputbox -attributes @{value = $session:freespace1 | Out-String}


I think this depends on your application pool…like if I am uploading stuff, I couldn’t upload it to a network U:\ drive I would have to specify the UNC path \servername\servershare\foldername
Try that approach it should sort your problem.