<?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 Powershell script to schedule Monthly SnapShots in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143195#M5859</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope someone can assist me please. I am now strugling for a few days to get a script to work. What I need to do is to create manual monthly snapshots, on all of the NetApp controllers in our environment, on all production volumes. This snapshots will then be mirrored to DR.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have done the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set executionpolicy remotesigned&lt;BR /&gt;Import-Module DataONTAP&lt;/P&gt;
&lt;P&gt;#Get Current Date and Save in the format YYYY_MM_DD&lt;BR /&gt;$Date = Get-Date -UFormat "%Y_%m_%d"&lt;BR /&gt;$Date&lt;/P&gt;
&lt;P&gt;#Set SnapShot Name&lt;BR /&gt;$SnapName = "monthly_backup_$Date"&lt;BR /&gt;$SnapName&lt;/P&gt;
&lt;P&gt;#Connect to Filers and create SnapShot&lt;BR /&gt;$filers = (Get-Content C:\Users\xxxxxxxxxx\Documents\filer_IP_list_toets.txt)&lt;/P&gt;
&lt;P&gt;Foreach ($filer in $filers)&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;Connect-NAController $filer -Credential root&lt;/P&gt;
&lt;P&gt;Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output returns the following up to&amp;nbsp;&lt;SPAN&gt;$SnapName&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set executionpolicy remotesigned&lt;BR /&gt;Import-Module DataONTAP&lt;/P&gt;
&lt;P&gt;#Get Current Date and Save in the format YYYY_MM_DD&lt;BR /&gt;$Date = Get-Date -UFormat "%Y_%m_%d"&lt;BR /&gt;$Date&lt;/P&gt;
&lt;P&gt;#Set SnapShot Name&lt;BR /&gt;$SnapName = "monthly_backup_$Date"&lt;BR /&gt;$SnapName&lt;/P&gt;
&lt;P&gt;#Connect to Filers and create SnapShot&lt;BR /&gt;$filers = (Get-Content C:\Users\&lt;SPAN&gt;xxxxxxxxxx&lt;/SPAN&gt;\Documents\filer_IP_list_toets.txt)&lt;/P&gt;
&lt;P&gt;Foreach ($filer in $filers)&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;Connect-NAController $filer -Credential root&lt;/P&gt;
&lt;P&gt;Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;2018_10_03 ($Date)&lt;BR /&gt;monthly_backup_2018_10_03 (&lt;SPAN&gt;$SnapName&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it asks for authentication:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return the following output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name&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; &amp;nbsp;Address&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ontapi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version &lt;BR /&gt;---- ------- ------ ------- &lt;BR /&gt;xxx.xxx.xxx.xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;1.21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NetApp Release 8.2.3&amp;nbsp; &amp;nbsp; &amp;nbsp;P2 7-Mode: Wed Mar 4 19:06:11 PST 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New-NaSnapshot : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.&lt;BR /&gt;At line:20 char:22&lt;BR /&gt;+ Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt; + CategoryInfo : InvalidArgument: (CZ1029_vol0:PSObject) [New-NaSnapshot], ParameterBindingException&lt;BR /&gt; + FullyQualifiedErrorId : InputObjectNotBound,DataONTAP.PowerShell.SDK.Cmdlets.Snapshot.NewNaSnapshot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the string cannot accet a pipe command?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas how I can get this working? I suppose it is something small that I am overlooking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 13:15:16 GMT</pubDate>
    <dc:creator>kobusventer</dc:creator>
    <dc:date>2025-06-04T13:15:16Z</dc:date>
    <item>
      <title>Powershell script to schedule Monthly SnapShots</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143195#M5859</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope someone can assist me please. I am now strugling for a few days to get a script to work. What I need to do is to create manual monthly snapshots, on all of the NetApp controllers in our environment, on all production volumes. This snapshots will then be mirrored to DR.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have done the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set executionpolicy remotesigned&lt;BR /&gt;Import-Module DataONTAP&lt;/P&gt;
&lt;P&gt;#Get Current Date and Save in the format YYYY_MM_DD&lt;BR /&gt;$Date = Get-Date -UFormat "%Y_%m_%d"&lt;BR /&gt;$Date&lt;/P&gt;
&lt;P&gt;#Set SnapShot Name&lt;BR /&gt;$SnapName = "monthly_backup_$Date"&lt;BR /&gt;$SnapName&lt;/P&gt;
&lt;P&gt;#Connect to Filers and create SnapShot&lt;BR /&gt;$filers = (Get-Content C:\Users\xxxxxxxxxx\Documents\filer_IP_list_toets.txt)&lt;/P&gt;
&lt;P&gt;Foreach ($filer in $filers)&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;Connect-NAController $filer -Credential root&lt;/P&gt;
&lt;P&gt;Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output returns the following up to&amp;nbsp;&lt;SPAN&gt;$SnapName&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set executionpolicy remotesigned&lt;BR /&gt;Import-Module DataONTAP&lt;/P&gt;
&lt;P&gt;#Get Current Date and Save in the format YYYY_MM_DD&lt;BR /&gt;$Date = Get-Date -UFormat "%Y_%m_%d"&lt;BR /&gt;$Date&lt;/P&gt;
&lt;P&gt;#Set SnapShot Name&lt;BR /&gt;$SnapName = "monthly_backup_$Date"&lt;BR /&gt;$SnapName&lt;/P&gt;
&lt;P&gt;#Connect to Filers and create SnapShot&lt;BR /&gt;$filers = (Get-Content C:\Users\&lt;SPAN&gt;xxxxxxxxxx&lt;/SPAN&gt;\Documents\filer_IP_list_toets.txt)&lt;/P&gt;
&lt;P&gt;Foreach ($filer in $filers)&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;Connect-NAController $filer -Credential root&lt;/P&gt;
&lt;P&gt;Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;2018_10_03 ($Date)&lt;BR /&gt;monthly_backup_2018_10_03 (&lt;SPAN&gt;$SnapName&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it asks for authentication:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return the following output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name&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; &amp;nbsp;Address&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ontapi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version &lt;BR /&gt;---- ------- ------ ------- &lt;BR /&gt;xxx.xxx.xxx.xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;1.21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NetApp Release 8.2.3&amp;nbsp; &amp;nbsp; &amp;nbsp;P2 7-Mode: Wed Mar 4 19:06:11 PST 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New-NaSnapshot : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.&lt;BR /&gt;At line:20 char:22&lt;BR /&gt;+ Get-NaVol $volName | New-NaSnapshot $SnapName&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt; + CategoryInfo : InvalidArgument: (CZ1029_vol0:PSObject) [New-NaSnapshot], ParameterBindingException&lt;BR /&gt; + FullyQualifiedErrorId : InputObjectNotBound,DataONTAP.PowerShell.SDK.Cmdlets.Snapshot.NewNaSnapshot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the string cannot accet a pipe command?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas how I can get this working? I suppose it is something small that I am overlooking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:15:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143195#M5859</guid>
      <dc:creator>kobusventer</dc:creator>
      <dc:date>2025-06-04T13:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to schedule Monthly SnapShots</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143196#M5860</link>
      <description>&lt;P&gt;Windows PowerShell Integrated Scripting Environment ISE | Microsoft Docs&lt;/P&gt;
&lt;DIV class="mainContainer uhf-container  has-top-padding " data-bi-name="body"&gt;
&lt;DIV class="columns "&gt;
&lt;SECTION class="primary-holder column is-two-thirds-tablet is-three-quarters-desktop"&gt;
&lt;DIV class="columns "&gt;
&lt;DIV id="main-column" class="column  is-full is-four-fifths-desktop "&gt;
&lt;H3 id="added-in-powershell-30-windows-server-2012-windows-8" class="heading-with-anchor"&gt;PowerShell 3.0 (Windows Server 2012&lt;/H3&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/SECTION&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:24:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143196#M5860</guid>
      <dc:creator>kobusventer</dc:creator>
      <dc:date>2018-10-03T12:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to schedule Monthly SnapShots</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143198#M5861</link>
      <description>&lt;P&gt;First it doesn't look like you are using a credentials object so it's going to prompt you each time...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out man connect-nacontroller.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it doesn't appear that you have a variable for&amp;nbsp;$volName .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:37:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-script-to-schedule-Monthly-SnapShots/m-p/143198#M5861</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2018-10-03T12:37:13Z</dc:date>
    </item>
  </channel>
</rss>

