Monday, October 31, 2016

AFTER clause

ALTER DATABASE database-name SET OFFLINE WITH ROLLBACK AFTER 120 SECONDS

Friday, October 14, 2016

a call to LogonUserW failed

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