well tbh - I'm having trouble getting it to work right now. I dont have a server to use so I setup a share on a remote workstation (that shouldn't be an issue ja?).

Made a couple of changes to your function for my own benefit.

1) Removed the MessageBox output and just slapped in some ? "..." type console messages.

2) Currently my $oADsSecurityUtility.SetSecurityDescriptor call is failing with the ubiquitous COM "unspecified error" right now. However, your UDF is not trapping this and ends up just returning an errorlevel 0 (i know this is a wip though) ...

Still plugging away.