The community will be undergoing maintenance soon, requiring Read-Only mode. Click to learn more.

Microsoft Virtualization Discussions

Setting "show-previous-versions"

drwoodberry

When I originally deployed some sites I would have a powershell script that would set the "show-previous-versions" property of a share using the following line:

Invoke-NcSsh vserver cifs share properties add -share-name sharename$ -share-properties access-based-enumeration show-previous-versions

 

However,

I have some older sites where this was not done, and I was trying to think of an easy way to loop through each share and set this. I have tried a couple things but have had no luck. Even the latest toolkit documentaion does not even show that as a property of "ShareProperties" on the Set-NcCifsSHare commandlet. I tries many different variations of the below syntax...I feel I am missing something simple. 

 

 

Is there an easy way to do this that I am missing to get this done, but avoid doing it to the normal "admin$,c$ and ipc$" shares?

 

$shares = Get-NcCifsShare

foreach ($share in $shares | where $_.sharename -notmatch "$"){Invoke-NcSsh vserver cifs share properties add -share-name $share.shareName -share-properties access-based-enumeration show-previous-versions}

1 ACCEPTED SOLUTION

asulliva

You can use the Set-NcCifsShare cmdlet to adjust share properties...

 

Get-NcCifsShare | %{ 
    if ($_.ShareProperties -notcontains "show_previous_versions" -and $_.ShareName -notin 'admin$','c$','ipc$') {
        $_ | Set-NcCifsShare -ShareProperties ($_.ShareProperties += "show_previous_versions")
    }
}

Hope that helps!

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

1 REPLY 1

asulliva

You can use the Set-NcCifsShare cmdlet to adjust share properties...

 

Get-NcCifsShare | %{ 
    if ($_.ShareProperties -notcontains "show_previous_versions" -and $_.ShareName -notin 'admin$','c$','ipc$') {
        $_ | Set-NcCifsShare -ShareProperties ($_.ShareProperties += "show_previous_versions")
    }
}

Hope that helps!

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public