thanks for your help though FYI the code worked but was slow and did reboot the DC when run on the client but when run on the DC it worked fine