Search code examples
directoryshareaccount

possible to add user to existing shared folder?


I'm trying to use psexec to add a user account to a shared folder. I tried this:

net share myshare=c:\myfolder /grant:"domain\bob",FULL

but it returns with "The name has already been shared". However, if I delete the share and then re-create it like this:

net share myshare/delete
net share myshare=c:\myfolder /grant:"domain\bob",FULL /grant:"jane",FULL /grant:"everyone",READ /grant:"sue",FULL

it works. But isn't there a way to just add a use to an existing share? Thanks


Solution

  • I was able to set the permissions using subinacl:

     http://www.microsoft.com/en-us/download/details.aspx?id=23510
    

    Some documentation/usage:

     http://myousufali.wordpress.com/2012/02/17/edit-permissions-with-subinacl/
    
     http://ss64.com/nt/subinacl.html
    

    And this is the command I used:

     subinacl /verbose=1 /share \\<ip>\<sharename> /grant=<username>=f