Don't worry \:\) I have run the script (with no parameters) and, as you say, it's very simple and has returned exactly my distinguished name. Thanks again for the help. Brilliant UDF.