I'm having a hard time grasping what you are trying to accomplish with the dsquery command. It seems like no matter what it is we should be able to do it completely in kix.