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!
AnvieAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.