• I'm a bit busy today to try to work on this, but at first glance, I think you'd need to remove the "\instancename" from the $servername variable in this line:

    $Driveobject=gwmi win32_logicaldisk -computername $servername -filter "DeviceID='$DriveLetter'"

    Shaun