NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

Microsoft Virtualization Discussions

RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

sjallabais
5,072 Views

Hi!

I want to do this:

$tmpShares = Get-NaCifsShare | Where-Object {$_.MountPoint -like "/vol/MyVol/*"}

$tmpShares | Remove-NaCifsShare

..

..do some magic with the volume, and then..

..

$tmpShares | Add-NaCifsShare

Remove-NaCifsShare works fine, but Add-NaCifsShare wont take this object as input from the pipe.

It works if I do a lot of "Select-Object @{Name="Path";Expression={$_."MountPoint"}}" stuff, but should

it be necessary to do a lot of parameter renaming on these? (I think not).

I know I also need to preserve and restore the ACL's with Get-NaCifsShareAcl, Set-NaCifsShareAcl, but they seems

to be "compatible" (I'll be happy if someone has a more elegant way of doing this procedure:)

/Sjalla

3 REPLIES 3

sjallabais
5,072 Views

On second thoughts, the most elegant would be that Get-NaCifsShare and Add-NaCifsShare also (optionally?) could handle the ACL's..

vinith
5,072 Views

Hello,

Add-NaCifsShare accepts values only by property by pipeline, hence you need to convert mountpoint to hashtable property of "path" and pass the values.

Thanks,

Vinith

vinith
5,072 Views

Hello,

Add-NaCifsShare accepts values only by property by pipeline, hence you need to convert mountpoint to hashtable property of "path" and pass the values.

Thanks,

Vinith

Public