I want to delete old backups from shared folder, which are located on separate NAS storage, using newly created SQL login. Is there any workaround to execute xp_delete_file using another account which is not a member of sysadmin role?


Deleting files on NAS should not be done by sql server. You should rather use powershell to do it.

You can use my function Clean-NASOldFiles which uses robocopy to scan files extremely fast and will then delete based on your input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.