UPHClean would probably help and we include it in our base image. That said, I don't think a logon script is the right place to enforce OS version standards. You should be able to determine centrally, the OS version and not allow it on the domain.

In what sort of (mis)managed environment would the end user be responsible for OS version?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.