How are you running the script, as a logon script or an admin script?

As your script is now, it would only poll the local computer.