November 22, 2016 at 6:33 am
Hello,
When I run the below command from PRod server to connect to a Non Prod server to see if that can fetch the details,
I get error -
xp_cmdshell 'Dir \\full server name\D$\MSSQL\BACKUP\folder\'
Output:
The user name or password is incorrect.
NULL
Is there anyway to force connect keeping in mind a proper security context.
How does sp_xp_cmdshell_proxy_account help? I tried to get some more help but did not get much. If you could suggest.
EXECUTE sp_xp_cmdshell_proxy_account 'domain\useracc','pass'
My ultimate object is to copy bkp files from PRod to Non Prod but both servers are in different domain.
Thanks.
November 22, 2016 at 6:51 am
If the path has spaces, use double quotes around it.
November 22, 2016 at 7:00 am
Basically trying to copy the bkp file from one server to another but both the servers are in two diff domains.
There is no space and I'm using double quotes.
EXECUTE xp_cmdshell 'copy "\\Prod_server\D$\MSSQL\BACKUP\bkp1.bkp" "\\dest_server\D$\MSSQL\BACKUP\"'
GO
Thanks.
November 22, 2016 at 7:18 am
I'll guess that you have a proxy account set to use xp_cmdshell. I'm also guessing that you're not using a sysadmin account to run xp_cmdshell. Then, I'll guess that the account set with sp_xp_cmdshell_proxy_account wasn't set correctly. If I'm correct, you'll have to make sure that you have the correct account and password for the proxy.
If I'm wrong, you should check permissions for the account used by xp_cmdshell.
November 22, 2016 at 7:26 am
I already have a Proxy account set. I am calling the xp_cmdshell using the SQL SSMS so I hope it should use sysadmin rights. No?
In order to use the proxy account while calling xp_cmdshell, how to modify the code?
Thanks.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply