like said, the script seems ok and thus, the problem is not the script but your config to get it running on each logon.
that is AD issue.
_________________________
!

download KiXnet