Thanks to all of you for your help. I've put the "/f" switch in batch file that runs the script and this didn't work. However, i changed the script to use the 'InGroup' function rather than 'MemberOf' and this started to use the registry entry described above.

So with the InGroup function and using the "/f" switch, this now works like a treat.

Thanks for your help.

Rob