Start a Conversation

Unsolved

This post is more than 5 years old

1829

February 19th, 2016 08:00

Using powershell to add share permissions to VNX CIFS share

I trying to see if there is anyway possible to add SMB Share permissions to a share that I have created on our VNX 5600.

Is it possible to create a powershell script to grab the share permissions off one folder, and add them to another folder?

thanks,

Brian

8.6K Posts

February 22nd, 2016 07:00

Sure – anything that just uses Win32 CIFS API’s should work as long as it doesnt require a server component like .NET

That’s what you use with your Windows clients explorer or through MMC

Try rmtshare – or sharedup if you just want to duplicate the share

8.6K Posts

February 22nd, 2016 08:00

Right – no WMI is what I meant

1.2K Posts

February 22nd, 2016 08:00

Look into the "Get-ACL" and "Set-ACl" Cmdlets, for setting NTFS permissions, if you need those as well.  You can use "Get-SharePermissions" to get the share permissions from the share and export them for review.  A quick Google search can turn up a user-provided script for automating share permissions.  Note, however, that you can't use WMI-based scripting, as the VNX doesn't support them.

But, as Rainer pointed out, sharedup is a quick-and-easy way to just copy share permissions without any scripting necessary.

Hope this helps!

February 22nd, 2016 08:00

Thanks Rainer, I hadn't seen "ShareDUP" before.  I will give that a shot.

I was aware of the Win32 CIFS API, however for some reason all the commands/scripts I have made have not worked for me.

Thanks Karl,

I already knew of the get/set-ACL cmdlets.  I have tried a vast number of different scripts that I wrote, as well as some that our friends at google turned up with no avail.  If I find something, or end up coming up with something that works, I will post it here. 

thanks,

Brian

No Events found!

Top