Powershell Shared Folder Permissions

Hi All,I have about 500 OS 2003, 2008, and 2012 servers in my network.I need to manage 'Share Permissions' of shared folders on these servers using powershell. Please note that I want to manage 'Share Permissions' that are set under shared folder properties' 'Sharing' tab, not NTFS permissions that are set under 'Security' tab.I need to either remove 'domainAuser1' or swap it with 'domainBuser1' with same permissions that 'domainAuser1' had.

Get Shared Folder Permissions Powershell

Shared

So far I found this link but the WMI portion of this manages NTFS permissions, not share permissions.So, I used this script from MSFT to log all the shared folders and their share permissions, and transferred them manually to a CSV file.Therefore, I will simply read the CSV for Server name, share name, and permissions.Can someone please help me how I can:1. Remove a user/group from share permissions2. Swap user/group with second domain with same share permissions. (I am guessing this step will be two fold, remove and then add)All this should be compatible with OS 2003, 2008, and 2012 (I am guessing this will be done with WMI)Thanks in advance.

Gmod spawn without weapons. You're quite right. Sorry, I overlooked that the share name was being resolved to the NTFS path and it was picking up the NTFS permissions.I don't think this is as straightforward as I first thought. Granting access to a share permission from the command line is pretty easy, you can use net share /grant in a PowerShell script but revoking access is harder.

I'm really struggling with the Win32LogicalShareSecuritySetting class which is what I think you'll need to use.I suspect the simplest route might be a 3rd party tool like.