I managed to find a solution to the Sid problem unbelievably in a macro called @SID - how ironic. However, I now need to write into the script that the logged on user must write their SID number to a file and then the scheduled task must read the sid number from the file and execute the script accordingly using the correct SID. Unfortunately if I use the @SID variable in the policy script it returns the SID of the scheduled task user and not the logged on user.
Ja, well... I did write the GetSID() UDF to get the SID of another user but then Jooel put my UDF to shame with his.
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=83064
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84323
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=175771
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.