SQL Server proxy account and local policy

If a user is a member of Sysadmin server role of SQL Server 2005, the user runs xp_cmd_shell in the security context of SQL Server service running account. If he is not a member of sysadmin role, the server proxy account must be setup, which is saved in the SQL Server system credential ##xp_cmdshell_proxy_account##. In this case the user runs xp_cmd_shell in the proxy account. However,sometimes you set up the server proxy account, and  even if the domain/windows account is added to the local
administrator group, the system stored procedure xp_cmd_shell may still fail with the error:
An error occurred during the execution of xp_cmdshell. A call to ‘LogonUserW’ failed with error code: ‘1385’
Run "net helpmsg 1385" in a windows console command, the message for the error code is:
Logon failure: the user has not been granted the requested logon type at this computer.
Actually the requetsed logon type is "log on as a batch job". The proxy account must have this privilege on the sql server local computer.
To solve the issue, run "All Programs–>Administrative Tools–>Local Security Policy", navigate to "Local Policies–>User Rights Assignment", find out "log on as a batch job" policy and double click it. If the proxy account is not in the list, add it. it’s not required to resart SQL server or agent service. It takes effect immediatley.
This entry was posted in SQL server 2005. Bookmark the permalink.

4 Responses to SQL Server proxy account and local policy

  1. ZHOU says:

    Thank you very much, it\’s really helpful!

  2. Johan says:

    Wow! Finally the (complete) info I needed!


    Johan Sijtsma

  3. Nikole says:

    Hi! I know this is somewhat off-topic however I had to
    ask. Does managing a well-established blog such as yours require a
    lot of work? I’m completely new to blogging however I do write in my diary everyday. I’d like to start a blog
    so I will be able to share my personal experience and thoughts online.
    Please let me know if you have any suggestions or tips for
    brand new aspiring blog owners. Appreciate it!

  4. kumar says:

    Thank you… this is definately a big problem solver for me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s