• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1359
  • Last Modified:

Logon failure: unknown user name or bad password.

Hi can anyone please help me....

when I run this query:
User Server01
EXEC master..xp_cmdshell 'MKDIR \\Server02\FolderName'

it retuned me this error:
Logon failure: unknown user name or bad password.

if I run this command in command prompt in server01
MKDIR \\Server02\FolderName

It works fine...

Just in SQL returned error...

but if I use this instead:
Use Server02
EXEC master..xp_cmdshell 'MKDIR \\Server01\FolderName'

it also works fine.

It just server01 can't access any of my server using SQL but any of my server can access server01

Please help me. I been dealing with this for a week now.

Thanks!
0
Anvie
Asked:
Anvie
  • 4
  • 3
1 Solution
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
It almost sounds like you have constrained delegation set up on server02 but not on server01.

Also, check the users of your server02 to see if any of the users that are allowed access are server01 users. Check both server users and sql users.

Do the same exercise on server01 to see how that is set up and look for differences.
0
 
Jerryuk007Commented:

You can also create a shared drive before calling your makedir using something like:
exec master..xp_cmdshell 'Net Use \\Server02\ /User:"mydomain\myuser myuserpassword" /ADD'
GO
EXEC master..xp_cmdshell 'MKDIR \\Server02\FolderName'
GO
exec master..xp_cmdshell 'Net Use \\Server02\ /DELETE'
GO

// You would need to check the exact syntax as I can't check it right now... ;-)

Hope this helps.

Jerry
0
 
AnvieAuthor Commented:
Hi Jerry, the drive has been shared but I still recieve the same error.
Logon failure: unknown user name or bad password.

I have to set of server sitting ing two different state. all SQL server in CA works fine. but the one in CH. I keep recieving this error when ever I will try to access file in CHsever01 --> CAserver01 but it work fin if I use it in CAserver01 -- CHsever02.

can anyone please help me.

Thanks!
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Jerryuk007Commented:
Remember that it's the SQL svc account who needs access...

Using AD ?

Jerry
0
 
AnvieAuthor Commented:
Yes... we are using AD. all servers are in one domain account too.
0
 
AnvieAuthor Commented:
ok ok ok... I tried to install SQL server 2005 in 3 different server and I recieved the same error. hmmm do you think it is the way I install it? I dont remember doing anything special or different than what I am doing right now. can anyone please give me idea what is going on. Thanks!
0
 
Jerryuk007Commented:
The SQL Server account needs to be a Domain User (no need to be a Domain Admin as MSSQL will create all the necessary access linke in the registry, File System, etc...). It often helps if it's a local administrator on the SQL Server(s)...

Do you have any accounts in an NTLM Domain (NT Domain, LDAP Domain,...) ?

Jerry
0
 
AnvieAuthor Commented:
F! I found out what is the problem. it is the way I installed the SQL server. I should use local system instaed using the domain. Thanks a lot everyone ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now