That script works fine for me Rob. Make sure your LDAP path is correct. It will give that error if it's not able to connect.