Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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}
Solved! See The Solution
1 ACCEPTED SOLUTION
drwoodberry has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
1 REPLY 1
drwoodberry has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
