0

I have multiple shared folders on server (windows server 2008) which are shared for multiple users.
My problem is I want to add give access of few folders to newly created domain user.
Now there are two things that I have noticed
1. Security tab: I am able to add user to to that red line using following command:

icacls d:\TestFolder /grant:r "username":(OI)(CI)F /T

and I can remove user from that list by using following command:

icacls  d:\TestFolder  /remove:g Administrator /T


Security tab

2. Sharing tab: Not able to add here.
By using above command, user is not get added to sharing tab.
So, I tried following command:

net share Docs=d:\TestFolder /grant:username=F

But, it works only first time. That is to share folder first time not for existing shared folder. enter image description here

Note: The image shows that folder has access to everyone, but this is just testing folder image, not from actual server. So the folder will not have access to everyone.

Apart from above command I tried with SubInACL.exe:

subinacl /verbose=1 /share d:\TestFolder /grant=username=f

But this command also add user to security tab not in sharing tab.
Please help me to find the command or let me know if it is possible or not using command line.

  • 1
    Why not use Everyone for the share and limit by using NTFS permissions? – Seth Sep 26 '17 at 9:55
  • @Seth as I have added Note, the image is not from the server. That everyone will not be there on server. – abpatil Sep 26 '17 at 10:57
  • Yes, but as e. g. detailed in this Technet article on Share and NTFS Permissions on a File Server NTFS permissions are the "more powerful" ones. You could simply restrict normal users on the NTFS level and "ignore" the share permissions. – Seth Sep 26 '17 at 11:01
  • @Seth thanks for sharing link. Still I am looking for the answer, As I want it in command line. – abpatil Sep 26 '17 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.