Found myself in the position of having to add some permissions to an existing file share… Unfortunately none of these systems were 2012R2, whom can take advantage of the SMBShare cmdlets, so this ended up being a bigger task than I would’ve thought. I found tons of help and posts on creating shares, but found a surprising lack of information on a task of this nature which I would’ve thought fairly basic.
Couple things to note:
- This only changes the actual file share permissions and does not touch the NTFS permissions.
- There are 5 variables that need to be addressed prior to running the script.
- One of those variables will require the Active Directory module imported to search specific OUs.
The AD module isn’t a mandatory item, computer names can certainly be fed in one at a time or by way of an array.
Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.