Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Logon failure: unknown user name or bad password.

Posted on 2008-11-05
10
Medium Priority
?
1,550 Views
Last Modified: 2012-05-05
I am trying to create new dir from one server to the another using SQL

 EXEC master..xp_cmdshell 'MKDIR \\ServerName\Test'

This work with all mt SQL server except for one.

Error: Logon failure: unknown user name or bad password.

Can anyone please help me!!!
0
Comment
Question by:Anvie
  • 5
  • 3
  • 2
10 Comments
 
LVL 15

Expert Comment

by:MohammedU
ID: 22890782
Make sure \\Servername exists and Make sure SQL service account has the access to create folder on the server.
0
 

Author Comment

by:Anvie
ID: 22890858
I am sure Servername exist and regarding on access. it should say access denied instead right?

I can create new folder from server to another server using cmd.exe but not SQL.

I have a question. how will I know what credential my SQL uses to access the folder from another server?

Thanks!
0
 
LVL 15

Expert Comment

by:MohammedU
ID: 22890910
Yes, you are right about the error but sometimes you may different error based on the way you are executing....
When you can create using cmd that means you have the access to the othere server because you logged into the souce server as you...
To test it try logged into the source server as SQL service accoutn and try or
Run the following in QA and see wha you get...
exec xp_cmdshell 'Dir \\servername\c$'
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:Anvie
ID: 22890927
Thanks!

I tried this: exec xp_cmdshell 'Dir \\servername\c$'
 And get the same error.  Logon failure: unknown user name or bad password.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22891445
The problem is that the SQL Server service account does not have the correct permissions to "ServerName".
0
 
LVL 15

Expert Comment

by:MohammedU
ID: 22891456
0
 

Author Comment

by:Anvie
ID: 22896509
hmmm how can I check if my SQL have correct permission?

I read you link MohammedU but it doesn't work...

;-(
0
 

Author Comment

by:Anvie
ID: 22896944
My server1 to 10 can access each even server11 but server11 can only access itself.

This works fin with all my server

EXEC master..xp_cmdshell '\\Server10\FolderName'

Except in Server11

please help!
0
 

Author Comment

by:Anvie
ID: 22900520
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
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 2000 total points
ID: 22901139
>>how can I check if my SQL have correct permission?<<
You need to find the account used by the SQL Server service account.  This is the account that does not ahve the necessary permissions to access Server11
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question