<?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: integrating a powershell post script with feedback in SC log file in Data Protection</title>
    <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8593#M2471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sivar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Informational:&lt;/P&gt;&lt;P&gt;We are running SC 3.6c on a windows 2008 R2 SP1 Datacenter Edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm able to run the powershell command from the command line, that's not the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;\temp&amp;gt;&lt;STRONG&gt;powershell -file c:\temp\perl\test_out.ps1 -quiesce&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:14:40#Quiescing application using script&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:14:40#Quiescing application finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But using this commandline as a command defined (see below) in the SC config file, powershell hangs on exit ( a known powershell bug)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get this working from within SC, I need to specify the command as this:&lt;/P&gt;&lt;P&gt;(running this command from the commandline works)&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;C:\temp&amp;gt;&lt;STRONG&gt;powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:12:58#Quiescing application using script&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:12:58#Quiescing application finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the output is generated as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the configfile we use this line to define the command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD04=SERVER: powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;small detail, the powershell postscript has to be executed on the SC server, not the agent. That's why we use "=SERVER:"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I don't get the output back in the SC's job logfile (not in output, debug, stderr, error). There seems to be an issue with output redirection.&lt;/P&gt;&lt;P&gt;A simple "dir c:\" generates output and this is logged in the debug log file:&lt;/P&gt;&lt;P&gt;As you can see, the output of the powershell script is not catched ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;[Wed Jan 16 20:26:00 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD01 [dir c:\]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] DEBUG: Executing command [dir c:\]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] TRACE: Command [dir c:\] finished with&lt;/P&gt;&lt;P&gt;exit code: [0]&lt;/P&gt;&lt;P&gt;stdout: [ Volume in drive C is Systeem&lt;/P&gt;&lt;P&gt; Volume Serial Number is 8C14-2468&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Directory of c:\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:06&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0dc02527c06adcadb321d14c73ce&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:32&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0f4e261c770e3a276bd4228318b37801&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:18&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADFS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 AUTOEXEC.BAT&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 CONFIG.SYS&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:37&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Documents and Settings&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inetpub&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:13&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostInstall&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:22&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files (x86)&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 16:31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.523 set.txt&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Utils&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30.389 VirtualizationAPI.dat&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:09&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINDOWS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:21&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmpub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 File(s)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32.912 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 Dir(s)&amp;nbsp;&amp;nbsp; 9.709.092.864 bytes free&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;stderr: []&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] DEBUG: Command [dir c:\] finished successfully with message&lt;/P&gt;&lt;P&gt;[ Volume in drive C is Systeem&lt;/P&gt;&lt;P&gt; Volume Serial Number is 8C14-2468&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Directory of c:\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:06&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0dc02527c06adcadb321d14c73ce&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:32&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0f4e261c770e3a276bd4228318b37801&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:18&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADFS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 AUTOEXEC.BAT&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 CONFIG.SYS&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:37&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Documents and Settings&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inetpub&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:13&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostInstall&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:22&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files (x86)&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 16:31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.523 set.txt&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Utils&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30.389 VirtualizationAPI.dat&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:09&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINDOWS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:21&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmpub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 File(s)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32.912 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 Dir(s)&amp;nbsp;&amp;nbsp; 9.709.092.864 bytes free&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command [dir c:\] finished successfully&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD04 [SERVER: powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command [ powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce] finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the main issue is output redirection of the post CMD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the command from the remove server via the agent does not work ether&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;[Wed Jan 16 20:41:05 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD04 [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [&lt;EM&gt;xxxxx&lt;/EM&gt;:9090(3.6.0.1)] DEBUG: Executing command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [&lt;EM&gt;xxxxx&lt;/EM&gt;:9090(3.6.0.1)] TRACE: Command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished with&lt;/P&gt;&lt;P&gt;exit code: [0]&lt;/P&gt;&lt;P&gt;stdout: []&lt;/P&gt;&lt;P&gt;stderr: []&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [hksql4:9090(3.6.0.1)] DEBUG: Command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished successfully with message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:05 2013] INFO: Running post data transfer command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2013 19:34:25 GMT</pubDate>
    <dc:creator>kris_boeckx</dc:creator>
    <dc:date>2013-01-16T19:34:25Z</dc:date>
    <item>
      <title>integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8583#M2469</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;What is the correct way to call a powershell script as a post command ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the example script from the folder "\plugins\examples\native\powershell"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try this: &lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD04=SERVER: powershell -file c:\temp\perl\test_out.ps1 -quiesce&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt; , powershell hangs and does not return&lt;/P&gt;&lt;P&gt;When I try this: &lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD04=SERVER: powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;, powershell return normal but the output (and yes, there is output) of the script is not catched by SC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see in the example that the output is formatted like:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;echo "SC_MSG#$level#$d#$message"&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Is this a requirement or optional ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 3 questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. What is the correct way to call a powershell script as a post command ?&lt;/P&gt;&lt;P&gt;2. How do I get the output of my powershell script into the log of SC ?&lt;/P&gt;&lt;P&gt;3. Is there a special requirement for the output of the powershell script, meaning: do I need to format the output in any way ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:12:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8583#M2469</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2025-06-05T06:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8588#M2470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kris,&lt;/P&gt;&lt;P&gt;I tried this in my lab and both options worked well for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to login as the snapcreator user (the domain username that runs the snapcreator service, not a system account), and execute the powershell commands manually?&lt;/P&gt;&lt;P&gt;I don't see a specific need to format the output, and hence as long as you can execute the below command as the snapcreator user account, your test should pass.&lt;/P&gt;&lt;P&gt;Please let me know if this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Users\sivar&amp;gt;set APP_NAME=oracle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Users\sivar&amp;gt;powershell -file C:\Users\sivar\Desktop\test_out.ps.ps1 -quiesce&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 13:33:36#Quiescing application using script oracle&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 13:33:36#Quiescing application finished successfully&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Users\sivar&amp;gt;powershell -inputformat none -file C:\Users\sivar\Desktop\test_out.ps.ps1 -quiesce&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 13:34:34#Quiescing application using script oracle&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 13:34:34#Quiescing application finished successfully&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 18:41:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8588#M2470</guid>
      <dc:creator>sivar</dc:creator>
      <dc:date>2013-01-16T18:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8593#M2471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sivar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Informational:&lt;/P&gt;&lt;P&gt;We are running SC 3.6c on a windows 2008 R2 SP1 Datacenter Edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm able to run the powershell command from the command line, that's not the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;\temp&amp;gt;&lt;STRONG&gt;powershell -file c:\temp\perl\test_out.ps1 -quiesce&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:14:40#Quiescing application using script&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:14:40#Quiescing application finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But using this commandline as a command defined (see below) in the SC config file, powershell hangs on exit ( a known powershell bug)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get this working from within SC, I need to specify the command as this:&lt;/P&gt;&lt;P&gt;(running this command from the commandline works)&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;C:\temp&amp;gt;&lt;STRONG&gt;powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:12:58#Quiescing application using script&lt;/P&gt;&lt;P&gt;SC_MSG#INFO#01/16/2013 20:12:58#Quiescing application finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the output is generated as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the configfile we use this line to define the command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD04=SERVER: powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;small detail, the powershell postscript has to be executed on the SC server, not the agent. That's why we use "=SERVER:"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I don't get the output back in the SC's job logfile (not in output, debug, stderr, error). There seems to be an issue with output redirection.&lt;/P&gt;&lt;P&gt;A simple "dir c:\" generates output and this is logged in the debug log file:&lt;/P&gt;&lt;P&gt;As you can see, the output of the powershell script is not catched ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;[Wed Jan 16 20:26:00 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD01 [dir c:\]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] DEBUG: Executing command [dir c:\]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] TRACE: Command [dir c:\] finished with&lt;/P&gt;&lt;P&gt;exit code: [0]&lt;/P&gt;&lt;P&gt;stdout: [ Volume in drive C is Systeem&lt;/P&gt;&lt;P&gt; Volume Serial Number is 8C14-2468&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Directory of c:\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:06&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0dc02527c06adcadb321d14c73ce&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:32&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0f4e261c770e3a276bd4228318b37801&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:18&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADFS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 AUTOEXEC.BAT&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 CONFIG.SYS&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:37&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Documents and Settings&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inetpub&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:13&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostInstall&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:22&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files (x86)&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 16:31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.523 set.txt&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Utils&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30.389 VirtualizationAPI.dat&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:09&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINDOWS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:21&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmpub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 File(s)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32.912 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 Dir(s)&amp;nbsp;&amp;nbsp; 9.709.092.864 bytes free&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;stderr: []&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] [hksql4:9090(3.6.0.1)] DEBUG: Command [dir c:\] finished successfully with message&lt;/P&gt;&lt;P&gt;[ Volume in drive C is Systeem&lt;/P&gt;&lt;P&gt; Volume Serial Number is 8C14-2468&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Directory of c:\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:06&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0dc02527c06adcadb321d14c73ce&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:32&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0f4e261c770e3a276bd4228318b37801&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:18&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADFS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 AUTOEXEC.BAT&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 CONFIG.SYS&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:37&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Documents and Settings&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 10:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inetpub&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 11:13&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostInstall&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:22&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program Files (x86)&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 16:31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.523 set.txt&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:19&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp&lt;/P&gt;&lt;P&gt;31/05/2010&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Utils&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30.389 VirtualizationAPI.dat&lt;/P&gt;&lt;P&gt;08/01/2013&amp;nbsp; 14:09&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINDOWS&lt;/P&gt;&lt;P&gt;19/04/2010&amp;nbsp; 09:21&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DIR&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmpub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 File(s)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32.912 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 Dir(s)&amp;nbsp;&amp;nbsp; 9.709.092.864 bytes free&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command [dir c:\] finished successfully&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD04 [SERVER: powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:26:01 2013] INFO: Running post data transfer command [ powershell -inputformat none -file c:\temp\perl\test_out.ps1 -quiesce] finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the main issue is output redirection of the post CMD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the command from the remove server via the agent does not work ether&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;[Wed Jan 16 20:41:05 2013] INFO: Running post data transfer command POST_NTAP_DATA_TRANSFER_CMD04 [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [&lt;EM&gt;xxxxx&lt;/EM&gt;:9090(3.6.0.1)] DEBUG: Executing command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce]&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [&lt;EM&gt;xxxxx&lt;/EM&gt;:9090(3.6.0.1)] TRACE: Command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished with&lt;/P&gt;&lt;P&gt;exit code: [0]&lt;/P&gt;&lt;P&gt;stdout: []&lt;/P&gt;&lt;P&gt;stderr: []&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:06 2013] [hksql4:9090(3.6.0.1)] DEBUG: Command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished successfully with message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Wed Jan 16 20:41:05 2013] INFO: Running post data transfer command [powershell -inputformat none -file \\hksnapcreator\c$\temp\perl\test_out.ps1 -quiesce] finished successfully&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 19:34:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8593#M2471</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2013-01-16T19:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8597#M2472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to be a powershell limitation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://connect.microsoft.com/PowerShell/feedback/details/315875/unable-to-capture-all-session-output-into-a-transcript" title="http://connect.microsoft.com/PowerShell/feedback/details/315875/unable-to-capture-all-session-output-into-a-transcript" target="_blank"&gt;http://connect.microsoft.com/PowerShell/feedback/details/315875/unable-to-capture-all-session-output-into-a-transcript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://maxt2posh.wordpress.com/2007/07/31/using-powershell-start-transcriptstop-transcript-commands/" title="http://maxt2posh.wordpress.com/2007/07/31/using-powershell-start-transcriptstop-transcript-commands/" target="_blank"&gt;http://maxt2posh.wordpress.com/2007/07/31/using-powershell-start-transcriptstop-transcript-commands/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://technet.microsoft.com/en-us/library/hh849687.aspx" title="http://technet.microsoft.com/en-us/library/hh849687.aspx" target="_blank"&gt;http://technet.microsoft.com/en-us/library/hh849687.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure whether the output of your powershell script can be redirected as you expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will let others on this thread to answer further.&lt;/P&gt;&lt;P&gt;Also, I will reach out to my powershell contacts if they can chime in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 20:05:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8597#M2472</guid>
      <dc:creator>sivar</dc:creator>
      <dc:date>2013-01-16T20:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8603#M2473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There seems to be a difference between running the config from the CLI versus GUI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;info: &lt;/P&gt;&lt;P&gt;The CLI (snapcreator.exe ...) is called from within a remote desktop session logged in with the domain administrator.&lt;/P&gt;&lt;P&gt;Then snapcreator service runs with the credentials of the domain administrator account.&lt;/P&gt;&lt;P&gt;The user that is used for the snapcreator GUI, does not exist on the local machine, nor on the domain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the config with "snapcreator.exe" from the CLI, everythings works OK (post-process powershell script is handled as it should be)&lt;/P&gt;&lt;P&gt;When I run the config from within the GUI, the config runs ok BUT the post-process powershell script hangs and is not handled as it should be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any explenation for this behavior ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 17:34:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8603#M2473</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2013-01-21T17:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8607#M2474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GUI just runs CLI but GUI will spawn CLI as the user who is running SC service. My guess is it is something to do with service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some tests and powershell commands hang when running as a service, you have to exit the shell otherwise service hangs and waits forever which could be issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some code from a plugin which makes a call to powershell, pay attention to the exit at end:&lt;/P&gt;&lt;P&gt;powershell.exe -psconsolefile $config_h{'SME_PS_CONF'} -command \"&amp;amp;{new-backup $config_h{'SME_BACKUP_OPTIONS'}; if (\$?) { exit 0 } else { exit 1 } }\" &amp;lt;NUL"&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="line" id="LC121"&gt;&lt;/P&gt;&lt;P class="line"&gt;Keith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 17:49:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8607#M2474</guid>
      <dc:creator>ktenzer</dc:creator>
      <dc:date>2013-01-21T17:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8611#M2475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;powershell.exe -psconsolefile $config_h{'SME_PS_CONF'} -command \"&amp;amp;{new-backup $config_h{'SME_BACKUP_OPTIONS'}; if (\$?) { exit 0 } else { exit 1 } }\" &amp;lt;NUL"&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the complete line ? I'm missing some stuf at the beginning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 20:57:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8611#M2475</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2013-01-21T20:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8616#M2476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my post command: Running the config from CLI works perfectly, running the config manualy with GUI hangs on this line. The script does not even start, powershell just hangs.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD01=SERVER: powershell -NonInteractive -noprofile -file "c:\utils\snapcreator\qsmr.ps1" -lv "%LOG_PATH_VERBOSE " -ld "%LOG_PATH_DEBUG " -sv "%SNAPMIRROR_VOLUMES " -so "%CUSTOM_NTAP_SNAPMIRROR_OPTIONS "&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can read on the internet, you should add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&amp;lt;NUL&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at the end of the command line. BUT when I do this, snapcreator gives me this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;WARN: [scf-00132] Invalid character "&amp;lt;" defined in parameter POST_NTAP_DATA_TRANSFER_CMD01, please check configuration file&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;So using &amp;lt;NUL at the end of my commandline is not accepted by snapcreator &lt;SPAN __jive_emoticon_name="sad" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.netapp.com/5.0.1/images/emoticons/sad.gif"&gt;&lt;/SPAN&gt;&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>Mon, 21 Jan 2013 21:21:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8616#M2476</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2013-01-21T21:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8621#M2477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working around the work around ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD01=SERVER: powershell -NonInteractive -noprofile -file "c:\utils\snapcreator\qsmr.ps1" -lv "%LOG_PATH_VERBOSE " -ld "%LOG_PATH_DEBUG " -sv "%SNAPMIRROR_VOLUMES " -so "%CUSTOM_NTAP_SNAPMIRROR_OPTIONS "&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;I was trying to get this working ... calling a powershell as a post process. It works when the config is executed from the commandline (snapcreator.exe --profile TESTSERVERS --action snap --policy daily --config hksql4.SD.daily.1 --verbose --debug)&lt;/P&gt;&lt;P&gt;I was not working when the config is executing using the GUI ... powershell hangs and never exits. If you want this to work, you need to add &amp;lt;NUL at the end of the powershell command BUT snapcreator sees the &amp;lt; as an invalid character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I called the help of a little helper (good old DOS &lt;SPAN __jive_emoticon_name="silly" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.netapp.com/5.0.1/images/emoticons/silly.gif"&gt;&lt;/SPAN&gt;) and changed the "POST_NTAP_DATA_TRANSFER" line to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;POST_NTAP_DATA_TRANSFER_CMD01=SERVER: C:\Utils\snapcreator\helper.cmd "c:\utils\snapcreator\qsmr.ps1" "%LOG_PATH_VERBOSE " "%LOG_PATH_DEBUG " "%SNAPMIRROR_VOLUMES " "%CUSTOM_NTAP_SNAPMIRROR_OPTIONS "&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basicly is just call's a batch file and it passed the given parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The batchfile "helper.cmd" contains (mind the &amp;lt;NUL at the end):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;powershell -NonInteractive -noprofile -file %1 -lv %2 -ld %3 -sv %4 -so %5 &amp;lt;NUL&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finaly, make sure the you:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Are running the snapcreator service as a domain user with local admin rights.&lt;/LI&gt;&lt;LI&gt;In the snapcreator config file: use a space at the end between the snapcreator variable and the quote.&lt;/LI&gt;&lt;LI&gt;Use the &amp;lt;NUL at the end of your powershell command.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a powershell script that is called by snapcreator, that logs it's output to the snapcreator log files of that job and exits as it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 08:53:24 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8621#M2477</guid>
      <dc:creator>kris_boeckx</dc:creator>
      <dc:date>2013-01-22T08:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: integrating a powershell post script with feedback in SC log file</title>
      <link>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8630#M2478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I was going to say create a wrapper script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SC allows most special chars in config file but "&amp;lt;" gives problems. SC must convert everything into SOAP since we use this for communications between agent and server and it is basically XML, so charachters like that break SC which is why we dont allow them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad you got it working, like you said sometimes simple things like DOS can provide good solutions &lt;SPAN __jive_emoticon_name="grin" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.netapp.com/5.0.1/images/emoticons/grin.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 09:31:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Data-Protection/integrating-a-powershell-post-script-with-feedback-in-SC-log-file/m-p/8630#M2478</guid>
      <dc:creator>ktenzer</dc:creator>
      <dc:date>2013-01-22T09:31:57Z</dc:date>
    </item>
  </channel>
</rss>

