# Using CMDEXEC with SF\_Mirror when xp\_cmdshell is restricted

**URL:** <https://community.cdata.com/t/using-cmdexec-with-sf-mirror-when-xp-cmdshell-is-restricted/1205>\
**Category:** CData DBAmp\
**Tags:** dbamp-upgrade, question, xp\_cmdshell, dbamp, sql-server\
**Created:** [September 25, 2025, 7:28pm UTC](https://community.cdata.com/t/using-cmdexec-with-sf-mirror-when-xp-cmdshell-is-restricted/1205 "2025-09-25T19:28:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrapoza](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@nrapoza](https://community.cdata.com/u/nrapoza)\
**Post date:** [September 25, 2025, 7:28pm UTC](https://community.cdata.com/t/using-cmdexec-with-sf-mirror-when-xp-cmdshell-is-restricted/1205/1 "2025-09-25T19:28:37Z")

</div>

We are upgrading from DBAMP v.4.1.8 to v.22.&nbsp; Because we are restricted from using xp\_cmdshell, most of our SQL Server Agent jobs run sf\_replicate.&nbsp; If I’m understanding the documentation correctly, we won’t be able to call sf\_replicate directly on v.22.

The CMDEXEC looks like this on 4.1.8:&nbsp;&nbsp;‘“C:\Program Files\DBAmp\DBAmpNet2.exe” replicate pkchunk,batchsize(25000) Account MyServerName&nbsp; MyDatabase SALESFORCE’

Will the call have to look something like this on v.22?

```auto
 "C:\Program Files\CData\CData DBAmp\bin\DBAmpAZ.exe" MirrorCopy Account MyServerName MyDataBase SALESFORCE pkchunk,batchsize(25000)

```

---

<div class="post-metadata">

**Author:** ![Ethem\_Q](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/ethem_q/32/1997_2.png) [@Ethem\_Q](https://community.cdata.com/u/Ethem_Q)\
**Post date:** [September 26, 2025, 4:42pm UTC](https://community.cdata.com/t/using-cmdexec-with-sf-mirror-when-xp-cmdshell-is-restricted/1205/2 "2025-09-26T16:42:42Z")

</div>

Hi ​ @nrapoza

As you already know a good amount of DBAmp’s stored procedures make use of xp\_cmdshell. DBAmp normally uses xp\_cmdshell to run the stored procedures, which usually requires sysadmin.&nbsp; Indeed there is an option to run the DBAmp stored procedures without xp\_cmdshell by calling the DBAmp app directly from the command line and that is available in v22 as well.

Here is documentation on SF\_Mirror for example: [DBAmp - Running the SF\_Mirror Procedure Without Using xp\_cmdshell](https://cdn.cdata.com/help/AFH/dbampd/HowToRunTheSF_MirrorProcWithoutUsingxp_cmdshell.html)

If you have any other questions, feel free to reach out to [support@cdata.com](mailto:support@cdata.com)&nbsp;with your query.
