Remove the line:
 Code:
$UserObj.Put("Password", "gensler")

And please take care of the values you put in.
They are not correct but will not pose an error.
I think you will find out when you remove the line I said.
You can then correct the values.

As far as the function goes, it works correctly as is provided you remove the above line. If you still get the same error then it is either:
A) Somewhere else in the script.
B) You haven't got the correct LDAP path.
C) You don't have enough privilidges to create accounts.