I copied the script you wrote to a HomeSize.kix file, changed the path to the homedirs share (\\server\homedirs$) and tried to run it.

Am I forgetting something ?