Logonuserw Returns Error 1326
Contents |
Escalation Services team. Troubleshooting xp_cmdshell failures ★★★★★★★★★★★★★★★ psssqlApril 10, 20082 Share 0 0 This post a call to 'logonuserw' failed with error code: '1326' assumes you have properly enabled the xp_cmdshell feature using the Surface a call to 'logonuserw' failed with error code: '1330' Area Configuration tool and you have used Management Studio | Server Properties | Security to establish a
A Call To Logonuserw Failed With Error Code 1385
proxy for xp_cmdshell execution. Sample command: master..xp_cmdshell ‘whoami' SQL Authentication: TestLogin (Public in pubs) When xp_cmdshell is executed it returns initialization errors with error message 15121. Msg 15121,
Xp_cmdshell Error Code 1326
Level 16, State 200, Procedure xp_cmdshell, Line 1 An error occurred during the execution of xp_cmdshell. A call to ‘API‘ failed with error code: ‘OS ERROR CODE‘. Use the API and OS ERROR CODE to troubleshoot problems. The API and OS ERROR CODEs can be looked up on MSDN. You can also use ‘net helpmsg ####' a call to logonuserw failed with error code 1329 to retrieve the text of the OS ERROR CODE. Bad Password (Server Properties | Security | Proxy does not validate password) If password is changed outside of Management Studio (Computer Management) so it is not in sync with SQL. If user was dropped and recreated from the system (Computer Management) so it has a SID change. Msg 15121, Level 16, State 200, Procedure xp_cmdshell, Line 1 An error occurred during the execution of xp_cmdshell. A call to ‘LogonUserW' failed with error code: ‘1326‘. 1326 = Logon failure: unknown user name or bad password. User does not have login as BATCH rights (Local Security Policy | User Rights Assignement | Logon As A Batch Job) Msg 15121, Level 16, State 200, Procedure xp_cmdshell, Line 1 An error occurred during the execution of xp_cmdshell. A call to ‘LogonUserW' failed with error code: ‘1385'. 1385 = Logon failure: the user has not been granted the requested logon type at this computer. Note: Drop the ‘W' when searching LoginUser not LoginUse
because LogonUserW returns error 1326. 0 Frinds, On last week I changed the User Account that starts the SQL Server services. After changing the User
Xp_cmdshell 1326
and restart SQL Server Services, i used the procedure xp_sqlagent_proxy_account 'set', 'domain', an error occurred during the execution of xp_cmdshell. a call to 'createprocess' failed 'user', 'pwd' and again restart SQL Server Services. Ps: The user is domain controller. Before changing the proxy account for xp_cmdshell User Account that starts the SQL Server Services, I could use the stored procedure xp_cmdshell with user without sysadmin privileges. My server was already with this option enabled (users https://blogs.msdn.microsoft.com/psssql/2008/04/10/troubleshooting-xp_cmdshell-failures/ without sysadmin privileges can execute xp_cmdshell) I a already restart proxy account with a new user and password (the domains is the same). But when i try to run xp_cmdshell with a user without sysadmin privileges, the following error is returned: Msg 50001, Level 1, State 50001 xp_cmdshell failed to execute because LogonUserW returns error 1326. please make https://ask.sqlservercentral.com/questions/3590/sql-2000-xp-cmdshell-failed-to-execute-because-log.html sure the service account SQL Server running under has appropriate privilege. For more information, search Book Online for topic related to xp_sqlagent_proxy_account. I have also checked the following policies for the User but this did not work: Access this computer from network Act as part of the Operating System Log on as a Service Replace a process level token Log on as a batch Job Anyone have any idea about this problemn? more ▼ 0 total comments 1442 characters / 217 words asked Dec 10, 2009 at 11:34 AM in Default Felipe 262 ● 23 ● 23 ● 26 add new comment (comments are locked) 10|1200 characters needed characters left ▼ Everyone Moderators Original poster and moderators Other... Viewable by all users 2 answers: sort voted first ▼ oldest newest voted first 0 Friends, I found the solution. The problem was in the User Password that SQL Server is now running under. The password must be less than 16 characters. I found the following post in "the trunk" of microsoft. Problem Description Syste
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 http://grumpydba.blogspot.com/2010/07/xpcmdshell-raises-error-call-to.html 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. Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Grumpy about: SQL General, a call xp_cmdshell 24 comments: Boon said... This Solution worked for me.. Thanks a lot for your help. 5 Nov 2010, 03:09:00 Kyle said... awesome ... thanks grumpy :) 11 Feb 2011, 16:52:00 Brian said... Worked for me too!Thx :) 7 Jul 2011, 14:33:00 Deependra said... Thanks a lot for the help. It worked. 26 Aug 2011, 18:18:00 Anonymous said... Thanks a lot . It worked for me as well 14 Oct 2011, 04:39:00 Anonymous said... Great.Thanks a lot.Worked for me too. 21 a call to Dec 2011, 23:27:00 Anonymous said... Thanks a lot Grumpy. It worked for me too! - signed Happy! 12 May 2012, 00:58:00 Grumpy DBA said... Good to see this one is still useful - I'm almost not Grumpy about that! 16 May 2012, 09:19:00 Anonymous said... Useful it is indeed, and high in Google rankings. Thanks for putting it up! 26 Jun 2012, 19:31:00 Anonymous said... Wow !!! It worked !! After searching for days... I finally made it ! Thanx a lot ! :) 25 Sep 2012, 13:22:00 Anonymous said... Gracias, señor, for the useful info. 2 Apr 2013, 14:40:00 Anonymous said... Also make sure that the account password is set to never expire in windows user manager 25 Apr 2013, 14:47:00 Rembrandt said... great info. why isnt this referred by MS on setup 15 May 2013, 17:25:00 Anonymous said... Amazing, thank you! 30 May 2013, 13:48:00 mina smith said... Love you!! Fixed this problem perfectly. 4 Dec 2013, 17:40:00 Corey Mingo said... Nice. This solved my problem. 30 Dec 2013, 18:59:00 Anonymous said... I have been searching for two days! Thank you so much! 3 Feb 2014, 18:25:00 Anonymous said... Worked a treat - thanks for posting that! 8 May 2014, 11:46:00 Anonymous said... Wonderful, thank you so much 3 Sep 2014, 15:15:00 Anonymous said... Thanks. Got me out of a jam. 20 Nov 2014, 17:12:00 Anonymous said... Thank you for taking the time to write. This worked for me. 8