rseraji
asked on
Logon failure: unknown user name or bad password.
sql2k sp3
I am boggled here. This isn't the typical scenario that normally generates
this message from what I can tell. I have all the necessary permissions from
what I know.
2 boxes.
1. All SQL Services run in the same Domain Administrator accout for both
boxes.
2. I have a linked server for Box2 on Box1. I can call
Box2.DBName.dbo.ProcName from Box1 with no problems.
3. I am logged in as the same Domain Admin account that all the services are
running under.
4. But I can't seem to use xp_cmdshell to copy a file from Box1 to Box2. I
get the above error message. 5. I can however take the "copy code" from
Query Analyzer and successfully run it from the DOS window.
All ideas are appreciated.
TIA, ChrisR
I am boggled here. This isn't the typical scenario that normally generates
this message from what I can tell. I have all the necessary permissions from
what I know.
2 boxes.
1. All SQL Services run in the same Domain Administrator accout for both
boxes.
2. I have a linked server for Box2 on Box1. I can call
Box2.DBName.dbo.ProcName from Box1 with no problems.
3. I am logged in as the same Domain Admin account that all the services are
running under.
4. But I can't seem to use xp_cmdshell to copy a file from Box1 to Box2. I
get the above error message. 5. I can however take the "copy code" from
Query Analyzer and successfully run it from the DOS window.
All ideas are appreciated.
TIA, ChrisR
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does doing a simple command work:
exec xp_cmdshell 'dir'
exec xp_cmdshell 'dir'
ASKER
No.
Do you get anything when you execute this:
EXEC master.dbo.xp_sqlagent_pro xy_account N'GET'
EXEC master.dbo.xp_sqlagent_pro
ASKER
Nothing returned.
Try this:
EXEC master.dbo.xp_sqlagent_pro xy_account N'SET', N'<Your Domain>', N'<Your User Name>', N'<Your Password>'
Then try this and see if you get any result:
EXEC master.dbo.xp_cmdshell 'dir'
EXEC master.dbo.xp_sqlagent_pro
Then try this and see if you get any result:
EXEC master.dbo.xp_cmdshell 'dir'
ASKER
Nope.
declare @Source varchar(128)
set @Source = '"dir \\Box2\c$"'
exec xp_cmdshell @Source
Logon failure: unknown user name or bad password.
But I can run this command from DOS.
declare @Source varchar(128)
set @Source = '"dir \\Box2\c$"'
exec xp_cmdshell @Source
Logon failure: unknown user name or bad password.
But I can run this command from DOS.
How about a simple "dir":
declare @Source varchar(128)
set @Source = 'dir'
exec xp_cmdshell @Source
try without the double-quotes in the 'dir'
declare @Source varchar(128)
set @Source = 'dir'
exec xp_cmdshell @Source
try without the double-quotes in the 'dir'
ASKER
Assuming you meant:
declare @Source varchar(128)
set @Source = 'dir \\Box2\c$\'
exec xp_cmdshell @Source
no, this doesnt work.
declare @Source varchar(128)
set @Source = 'dir \\Box2\c$\'
exec xp_cmdshell @Source
no, this doesnt work.
How about a simple dir without the \\Box2\c$:
declare @Source varchar(128)
set @Source = 'dir'
exec xp_cmdshell @Source
I am trying to determine if the error is caused by the xp_cmdshell command or by connecting to the \\Box2 server.
If this command returns a result set, then check if there is a local account/user name in Box2 having the same user name that you are using. If there is, the local account/user name might have a different password than the domain account.
declare @Source varchar(128)
set @Source = 'dir'
exec xp_cmdshell @Source
I am trying to determine if the error is caused by the xp_cmdshell command or by connecting to the \\Box2 server.
If this command returns a result set, then check if there is a local account/user name in Box2 having the same user name that you are using. If there is, the local account/user name might have a different password than the domain account.
ASKER
Yes that works. The Local Admin on theat box has a different password than the Domain Admin Im using. Dont forget:
4. But I can't seem to use xp_cmdshell to copy a file from Box1 to Box2. I
get the above error message. 5. I can however take the "copy code" from
Query Analyzer and successfully run it from the DOS window.
4. But I can't seem to use xp_cmdshell to copy a file from Box1 to Box2. I
get the above error message. 5. I can however take the "copy code" from
Query Analyzer and successfully run it from the DOS window.
ASKER
Also, I changed the local admin on that box to the same as the Domain Admin, and still have the problem.
Here's a long shot and I don't know if it can be an option for you. Why not map \\Box2\c$ as a local drive and simply use this instead of the network drive?
ASKER
This fixed it and I dont know why.
-- ACCOUNTDOMAIN is the domain where 'account' belongs to
EXEC xp_cmdshell 'dir \\BoxName\Share password
/USER:MYDOMAIN\administrat or'
GO
I only had to do it the first time and now my original command works with no problems.
-- ACCOUNTDOMAIN is the domain where 'account' belongs to
EXEC xp_cmdshell 'dir \\BoxName\Share password
/USER:MYDOMAIN\administrat
GO
I only had to do it the first time and now my original command works with no problems.
ASKER