ALTER DATABASE database-name SET OFFLINE WITH ROLLBACK AFTER 120 SECONDS
xp_cmdshell raises error “a call to LogonUserW failed with error code 1385”
An error occurred during the execution of xp_cmdshell. A call to ‘LogonUserW’ failed with error code: ‘1385’.
In order to fix this you need to open the Local Security Settings on the host machine.
Navigate to Security Settings -> Local Policies -> User Rights Assignment.
Open “Log on as a batch job” and add the user assigned as the xp_cmdshell proxy account