xp_cmdshell requires a couple of permissions to enable non-sysadmin users to run it, and even when you think you have enabled it in surface area config, and assigned an account to the ##xp_cmdshell_proxy_account##, you will frequently find you still encounter the following error:
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.
Now open "Log on as a batch job" and add the user you assigned to the xp_cmdshell proxy account - and you should find it runs fine now.
28 comments:
This Solution worked for me..
Thanks a lot for your help.
awesome ... thanks grumpy :)
Worked for me too!
Thx :)
Thanks a lot for the help. It worked.
Thanks a lot . It worked for me as well
Great.Thanks a lot.Worked for me too.
Thanks a lot Grumpy. It worked for me too! - signed Happy!
Good to see this one is still useful - I'm almost not Grumpy about that!
Useful it is indeed, and high in Google rankings. Thanks for putting it up!
Wow !!! It worked !! After searching for days... I finally made it ! Thanx a lot ! :)
Gracias, seƱor, for the useful info.
Also make sure that the account password is set to never expire in windows user manager
great info. why isnt this referred by MS on setup
Amazing, thank you!
Love you!! Fixed this problem perfectly.
Nice. This solved my problem.
I have been searching for two days! Thank you so much!
Worked a treat - thanks for posting that!
Wonderful, thank you so much
Thanks. Got me out of a jam.
Thank you for taking the time to write. This worked for me.
Perfect fix. So helpful!
Thanks GDBA! This worked like a charm.
This has helped me as well. Thanks!
Works! Thanks
an error occurred during the execution of xp_cmdshell.a call to 'logonuserW' failed with error code:1326
it is throwing above error even I had granted execute on [domain\user]. Could anyone help me on the same.
Thank you. Reminded me of the fix just when I needed it
Post a Comment