<?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: Append additional property to existing cifs share using Powershell in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129408#M28128</link>
    <description>&lt;P&gt;I should have added a little more detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most shares are with the default settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How many shares are outside of the following default settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oplocks, browsable, changenotify, show_previous_versions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can just push all these settings back down by doing a get | set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have different requirements, you can do stuff like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$share = (get-nccifsshare -VserverContext vservername&amp;nbsp;-ShareName data$).shareproperties -join ","&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's your current properties of the share,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can adjust $share each time and re-write it each time. &amp;nbsp;Fairly simple&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 20:08:17 GMT</pubDate>
    <dc:creator>JGPSHNTAP</dc:creator>
    <dc:date>2017-03-24T20:08:17Z</dc:date>
    <item>
      <title>Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129394#M28124</link>
      <description>&lt;P&gt;Given whatever change occurred between us running 8.3 and now being at Ontap 9.1, we need to add the &lt;STRONG&gt;show_previous_versions&lt;/STRONG&gt; property to a number of cifs shares to give users VSS functionality back.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone know how to append instead of replace the properties using the&amp;nbsp;Set-NcCifsShare cmdlet for a given cifs share?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 15:17:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129394#M28124</guid>
      <dc:creator>bsnyder27</dc:creator>
      <dc:date>2025-06-04T15:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129402#M28125</link>
      <description>&lt;P&gt;^^&lt;/P&gt;&lt;P&gt;Start with this one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Set-NcCifsShare&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 18:15:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129402#M28125</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2017-03-24T18:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129404#M28126</link>
      <description>&lt;P&gt;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://community.netapp.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 19:26:26 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129404#M28126</guid>
      <dc:creator>swirlypillow</dc:creator>
      <dc:date>2017-03-24T19:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129406#M28127</link>
      <description>&lt;P&gt;was there more to this comment?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 19:44:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129406#M28127</guid>
      <dc:creator>bsnyder27</dc:creator>
      <dc:date>2017-03-24T19:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129408#M28128</link>
      <description>&lt;P&gt;I should have added a little more detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most shares are with the default settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How many shares are outside of the following default settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oplocks, browsable, changenotify, show_previous_versions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can just push all these settings back down by doing a get | set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have different requirements, you can do stuff like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$share = (get-nccifsshare -VserverContext vservername&amp;nbsp;-ShareName data$).shareproperties -join ","&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's your current properties of the share,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can adjust $share each time and re-write it each time. &amp;nbsp;Fairly simple&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:08:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129408#M28128</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2017-03-24T20:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Append additional property to existing cifs share using Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129411#M28130</link>
      <description>&lt;P&gt;I did it like this using a foreach loop, to keep the current set of share properties and just append the "show_previous_versions" property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$results = @()&lt;/P&gt;&lt;P&gt;Connect-NcController -Name $controller -Credential $creds -Verbose&lt;/P&gt;&lt;P&gt;$shares = Get-NcCifsShare -CifsServer $cifsserver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$results = $shares|? Path -like "*path_string_here*"|? ShareProperties -NotContains "show_previous_versions"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach ($result in $results)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{$change_array = @()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$change_array = $result.shareproperties + "show_previous_versions"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Set-NcCifsShare -Name $result.ShareName -ShareProperties $change_array -VS vserver_name_here}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Didn't think about using -join "," but that works really well too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Also, I filtered on a group of CIFS shares that shared a common string in the path that I knew I wanted to isolate, which is why I used the Where-Object -like "*path_string_here*", but you could leave that off and then echo out $results to see what paths do not have "show_previous_versions." &amp;nbsp;You can also add the -whatif parameter to Set-NcCifsShare to see what would be changed before making the change.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:40:59 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Append-additional-property-to-existing-cifs-share-using-Powershell/m-p/129411#M28130</guid>
      <dc:creator>swirlypillow</dc:creator>
      <dc:date>2017-03-24T20:40:59Z</dc:date>
    </item>
  </channel>
</rss>

