Microsoft Virtualization Discussions

Rename CIFS Share

tyrone_owen_1

Hi,

 

I hope that you can help.

 

I want to rename a bunch of CIFS shares using the PSTK - I don't think you can technically rename a share so I am creating/deleting. I'm using the following to retrieve the current share properties that I am interested in keeping:

 

$oldshareproperties = Get-NcCifsShare -Name $oldshare |
    Select-Object ShareName,Acl,Path,Comment,Vserver,OfflineFilesMode,ShareProperties

 

I'm then creating some variables to create the new share name with the existing properties:

 

$newshare = "$($oldshareproperties.ShareName)RO$"
$activepath = $oldshareproperties.Path
$newcomment = "READ ONLY $($oldshareproperties.Comment)"
$newofflinemode = $oldshareproperties.OfflineFilesMode
$newproperties = $oldshareproperties.ShareProperties

Add-NcCifsShare -Name $newshare -Path $activepath -Comment $newcomment -OfflineFilesMode $newofflinemode -ShareProperties $newproperties

I can capture the ACL (everyone / read) from the existing share but how do I turn these into arguments for the Set-NcCifsShareAcl, i.e. -UserOrGroup and -Permission?

 

Thanks

0 REPLIES 0
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