assuming the script is on a *nix server, mount the remote filsystem using nfs or smb as suggested above, using the -o paramaters to set the 'owner' or proper rights to the mounted folder
Second run the script as the user that has the rights on the mounted dir.