<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to call a powershell script from a SC config (pre or post action) in Data Protection</title>
    <link>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5587#M810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try this in our new installation (SC4.1P1). I know this did not work well in SC 3.6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will get back to you when I have time to test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Apr 2014 12:55:52 GMT</pubDate>
    <dc:creator>kris_boeckx</dc:creator>
    <dc:date>2014-04-03T12:55:52Z</dc:date>
    <item>
      <title>How to call a powershell script from a SC config (pre or post action)</title>
      <link>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5577#M808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SC Environment: All servers are Microsoft Windows Server 2008 R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a document that describes how to call a powershell script from a SC config to do some pre and post actions ? (for example POST_NTAP_DATA_TRANSFER_CMD01=)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to call a powershell script and pass it several parameters. Those parameters are SC variables and my own variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Kris Boeckx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:38:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5577#M808</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2025-06-05T05:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a powershell script from a SC config (pre or post action)</title>
      <link>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5582#M809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Snap Creator simply passes commands onto the systems command interpreter, so you will need to figure out a command string that you can call from Windows to execute the PowerShell command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that you will need to call powershell.exe then add &amp;amp;&amp;amp; to tell Snap Creator to run the next command within PowerShell (so the command is passed as a single line)&lt;/P&gt;&lt;P&gt;Here is a similar example that is calling a Teamcenter shell instead of a PowerShell...shell:&amp;nbsp; &lt;/P&gt;&lt;P&gt;C:\PROGRA~1\Siemens\TEAMCE~1\tc_menu\TcEng_config1.bat &amp;amp;&amp;amp; backup_modes.exe -u=infodba -p=infodba -g=dba -m=normal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the command works with your variables, you can add in the Snap Creator variables and include the command into Snap Creator's PRE and POST commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to be sure to add any commands that you are calling to the allowed_commands.config file on the Agent.&amp;nbsp; You also must restart the Agent to get the allowed_commands to be accepted.&lt;/P&gt;&lt;P&gt;In the example command above I have to add the following to allowed_commands.config:&lt;/P&gt;&lt;P&gt;command:C:\PROGRA~1\Siemens\TEAMCE~1\tc_menu\TcEng_config1.bat&lt;/P&gt;&lt;P&gt;command:backup_modes.exe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Snap Creator knows these are two different commands, so they must both be added.&lt;/P&gt;&lt;P&gt;Since backup_modes.exe isn't fully qualified when we call it, it doesn't have to be fully qualified in the allowed_commands.config file either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a video on adding allowed commands here:&amp;nbsp; &lt;A class="active_link" href="https://www.youtube.com/watch?v=niZYjI710_Q" title="https://www.youtube.com/watch?v=niZYjI710_Q" target="_blank"&gt;https://www.youtube.com/watch?v=niZYjI710_Q&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I also have a video coming on using the APP_QUIESCE and APP_UNQUIESCE commands in Snap Creator.&amp;nbsp; That video is recorded, but need to be edited and reviewed.&lt;/P&gt;&lt;P&gt;The concept should be similar to what you are trying to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 11:59:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5582#M809</guid>
      <dc:creator>spinks</dc:creator>
      <dc:date>2014-04-02T11:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a powershell script from a SC config (pre or post action)</title>
      <link>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5587#M810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try this in our new installation (SC4.1P1). I know this did not work well in SC 3.6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will get back to you when I have time to test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 12:55:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/How-to-call-a-powershell-script-from-a-SC-config-pre-or-post-action/m-p/5587#M810</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2014-04-03T12:55:52Z</dc:date>
    </item>
  </channel>
</rss>

