May 15, 2008 at 3:53 am
I am accessing network shared folder through xp_cmdshell
as
exec master..xp_cmdshell 'dir \\server1\sharedfolder\*.*'
but i am getting an error
Logon failure: unknown user name or bad password.
May 15, 2008 at 4:02 am
It's been a while since I've used xp_cmdshell - and you shouldn't really use it - but I think that when using xp_cmdshell you're going to be running in the context of the account that runs the SQL Server service.
So check that the service account has permissions to the folder. You can always run SET USERNAME through the xp_cmdshell to see which user it is running with.
Hope that helps,
May 15, 2008 at 4:16 am
How to set username........
How we can know which user is running
May 15, 2008 at 4:20 am
exec master..xp_cmdshell 'SET USERNAME'
That will give you the user that the cmdshell is running under.
May 15, 2008 at 4:26 am
my user name is xyz_user then this user should have access to that shared folder???.......
is this correct???....
Thanks and Regards,
Jagdish B
May 15, 2008 at 4:33 am
That's correct
May 15, 2008 at 4:47 am
Thanks Karl for ur comments
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply