What privileges are necessary to restore via command line from a scheduled task?

I am trying to restore a backup via command line as part of a Windows scheduled task. The restore runs successfully from a PowerShell console, but fails when run as a scheduled task using the same user. If I add the user to the Administrators group, the task succeeds, but I would like to grant only the necessary privileges.

The LiteSpeed error message:

LiteSpeedr for SQL Serverr could not create the virtual backup device for the database.

SQLVDI generates the following event in the event log:

SQLVDI: Loc=IdentifySQLServer. Desc=MSSQLSERVER. ErrorCode=(5)Access is denied.
. Process=4900. Thread=972. Client. Instance=. VD=.

The scheduled task is set to run with highest privileges and the user has been granted privileges to create global objects in secpol.msc. The user is part of the sysadmin role on the SQL Server.

What additional privileges do I need to grant the Windows user for the scheduled task to work?

  • Hello ,

    The error you see...

    LiteSpeedr for SQL Serverr could not create the virtual backup device for the database.

    As you discovered is  caused when the account running the Litespeed engine is not an administrator.

    To create the VDI that SQL uses to communicate with Litespeed requires Local admin access.

    This is a SQL limitation and sadly I am aware of no workaround.

    Also please note when running a backup from the command line on a server with UAC the command line prompt should be elevated to admin ( the "run as administrator" option) even when the account that opened the command line is already a local admin to the box.

    Hope this helps,

    -Ben-

  • It's too bad that there is no way to restore LiteSpeed backups from command line without administrator rights.

    Thank you for your help.