LogOn Failure Error

  • 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.

  • 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,

  • How to set username........

    How we can know which user is running

  • exec master..xp_cmdshell 'SET USERNAME'

    That will give you the user that the cmdshell is running under.

  • my user name is xyz_user then this user should have access to that shared folder???.......

    is this correct???....

    Thanks and Regards,

    Jagdish B

  • That's correct

  • 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