Change the default shared folder permissions

Started by hienpham, March 26, 2015, 08:31:10 AM

Previous topic - Next topic

hienpham

Hello,
   Can we somehow using WinBatch change the Default shared folder permissions from Everyone to something like Domain Users?
The article https://helgeklein.com/blog/2010/07/where-are-share-permissions-stored-hint-registry/ give us a hint but it's not practical for a WinBatch script.

Thanks so much for any help.

hien

td

Check out the Network Extender's  wntAccessDel and wntAccessAdd functions in the WIL Consolidated help file.  They can be used to modify share permissions.  Share permissions can get a bit tricky because more than one protocol can be used and the NTFS file permissions can trump share permissions.  Take a look at the functions, give them a try, and when you encounter difficultly post the details so we can try to help.

There is some additional information in the Tech Database you can find  by searching on the functions.

Good luck.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

hienpham

Thanks TD,
   I already wrote a WinBatch program that scans for all EXISTING shares that have Everyone and change that Everyone to the Domain Users. That program has been working for years really great, but it did not prevent people from creating new shares with Everyone again. We have to deploy it regularly to fix those things (at one time we planned to add it to the RUN registry to scan the system when the user log in but this will hurt the user login time and we don't want to do that.)
Our goal now is somehow whenever the user creates a share, he/she will see that the default user is Domain Users instead of Everyone.

Thanks again TD for your advices.

hien

td

OK.  Sorry I misunderstood your question.  I have never tried it but you should be able to change the default share permissions by creating and setting the following registry value

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity[SrvsvcDefaultShareInfo]

It's a binary value so you could copy the contents of a value under

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Shares\Security

from a share with the security you want into the  SrvsvcDefaultShareInfo value.

Of course all this could be done with WinBatch Reg functions and again I have never tried it so your mileage may vary.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade