Comments
4 comments
-
Hi @TShubick
Having a look at the error from the xp_cmdshell, it appears it's running on a machine that's not licensed. I would recommend remoting into the server(s) that you run this command on and sign into the products with your Redgate ID to license them.
Let me know if that doesn't solve it. -
Kurt,
If you look at the output above, the first result was running the bat file on the server where Redgate is licensed via SQL Server. The second result was running the exact same bat file on the same server but using a CMD window to run it. -
I came here to look for a very similar answer.
I put together a BAT file that creates snapshots of multiple databases. It runs perfectly fine on the server -- via command line, Powershell, etc. If I attempt to execute the BAT file through a SQL Agent job (using either PowerShell or CmdExec) with a proxy account that has full admin rights everywhere, I am getting an access denied error.
I know this account has full access to all locations and servers involved, in fact I use that same account (on the same server) for RG Masking and Cloning operations without issue. I noticed an article about command line and licensing, so now I am wondering if the "Access Denied" is really a licensing error under the hood. -
Hi @TShubick
SQL Compare (and most of our tools) are not licensed per server, they are licensed per user. So running on the server is not sufficient, you will need to run it using the same Windows user it is licensed for.
If you have a Redgate Deploy license, then editing the .bat file and including the /allusers switch should workaround this.
@pharrell
An access denied error would most likely indicate it can't access the .bat file from wherever it's stored. I also encountered this error while testing the above script from @TShubick
I used a proxy account as well, and found it didn't have the required permissions to access it. Once I reverted to using a different account with full access (sysadmin), it worked fine.
In addition to this, there could be a licensing error involved as well, as this proxy account is, I assume, not the same account which is licensed for SQL Compare.
Add comment
Please sign in to leave a comment.
From SQL Sever:
EXEC master.dbo.xp_cmdshell 'C:\scripts\FT_DEMOToSIC_DEMO.bat'
From CMD