<?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: PowerShell - Set Snaplock type as Compliance in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436785#M40968</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use Invoke-NcSystemApi...something like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$command = @("snapshot", "modify-snaplock-expiry-time", "-vserver", $vserverName, "-volume", $VolumeName, "-snapshot", $snapshotName, "-expiry-time", """$expiryTime""")
$api = $("&amp;lt;system-cli&amp;gt;&amp;lt;args&amp;gt;&amp;lt;arg&amp;gt;" + ($command -join "&amp;lt;/arg&amp;gt;&amp;lt;arg&amp;gt;") + "&amp;lt;/arg&amp;gt;&amp;lt;/args&amp;gt;&amp;lt;/system-cli&amp;gt;")
Invoke-NcSystemApi -Command $command -ErrorAction Stop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2022 07:09:37 GMT</pubDate>
    <dc:creator>mbeattie</dc:creator>
    <dc:date>2022-07-19T07:09:37Z</dc:date>
    <item>
      <title>PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436773#M40967</link>
      <description>&lt;P&gt;Does anyone know of a cmdlet or way that I can set the Snaplock type as compliance using Powershell? Can't seem to find a cmdlet that will let me do this.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:58:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436773#M40967</guid>
      <dc:creator>goodmanr0732</dc:creator>
      <dc:date>2025-06-04T09:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436785#M40968</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use Invoke-NcSystemApi...something like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$command = @("snapshot", "modify-snaplock-expiry-time", "-vserver", $vserverName, "-volume", $VolumeName, "-snapshot", $snapshotName, "-expiry-time", """$expiryTime""")
$api = $("&amp;lt;system-cli&amp;gt;&amp;lt;args&amp;gt;&amp;lt;arg&amp;gt;" + ($command -join "&amp;lt;/arg&amp;gt;&amp;lt;arg&amp;gt;") + "&amp;lt;/arg&amp;gt;&amp;lt;/args&amp;gt;&amp;lt;/system-cli&amp;gt;")
Invoke-NcSystemApi -Command $command -ErrorAction Stop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 07:09:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436785#M40968</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2022-07-19T07:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436798#M40970</link>
      <description>&lt;P&gt;This is for when creating the volume. When creating a volume in the ontap CLI there is a -snaplock-type option when doing a volume create command that you can set as either non-snaplock, compliance, or enterprise. The New-NcVol cmdlet doesn't seem to have a parameter for that and can't find any other cmdlet that has that either.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 14:10:26 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436798#M40970</guid>
      <dc:creator>goodmanr0732</dc:creator>
      <dc:date>2022-07-19T14:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436810#M40972</link>
      <description>&lt;P&gt;Which version of ONTAP are you using? There is a snaplock type in the REST API (not certain which version it's introduced in but it's available in ONTAP 9.10). If your ONTAP version supports the snaplock feature when creating a volume you could use the REST API instead of a PSTK CmdLet. If that's not an option for you then in the interim you could use the CLI command to create a volume and pass the command via "Invoke-NcSystemApi" as per the example above (not ideal but it would work). Also there is work being done on a PSTK version that leverages the REST API's so i would imagine this will be available in a future release. I'll check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="volume_snaplock.png" style="width: 999px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/23965i8AF29A5DCA2EAB40/image-size/large?v=v2&amp;amp;px=999" role="button" title="volume_snaplock.png" alt="volume_snaplock.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 23:20:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436810#M40972</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2022-07-19T23:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436813#M40974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked a development release of the PSTK and SnapLock properties are being included in a future release within the New-NcVol CmdLet that leverages the REST API's. There is work being done to address the functionality gap but I'm not sure when it will be released&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    -Snaplock [&amp;lt;DataONTAP.C.Types.Volume.Snaplock&amp;gt;]
        Specifies the snaplock attribute to use for this volume. To instantiate the please create object using New-Object DataONTAP.C.Types.Volume.Snaplock. This parameter is supported with Rest only.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false&lt;/LI-CODE&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 05:36:00 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436813#M40974</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2022-07-20T05:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell - Set Snaplock type as Compliance</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436822#M40977</link>
      <description>&lt;P&gt;Thank you for looking into that, glad to see that it will be coming. Think for now I'll just look at trying a REST API call to do it.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 16:05:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/PowerShell-Set-Snaplock-type-as-Compliance/m-p/436822#M40977</guid>
      <dc:creator>goodmanr0732</dc:creator>
      <dc:date>2022-07-20T16:05:17Z</dc:date>
    </item>
  </channel>
</rss>

