Check out the AD Cookbook

It's vbscript, but is easily converted

_________________________
Eric