By the way...just to add to the info...
I ran the script until it broke again last night...then tried to run it again this morning to see if there is just some strage replication issue somewhere in my domain, but the script is still broken.

I copied the script and the .dll files to my local pc and ran the script manually and everything mapped and worked fine. Just cant get it to run from the server automatically everytime.

Thanks for your help