Creating permissions on a new share
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Creating permissions on a new share
I'm a total newbee at scripting so please be patient, if I sound like I'm slow to catch on its because scripting isn't my specialty, I've got quite a learning curve ahead.I'm attempting to create/delete a Share remotely. Here is a copy of my two scripts up to this point and I'm taking advantage of PsExec.exe for the second. I'm also trying to run these scripts from, and on, either a XP/NT/Server 2k/Server 2k3 domain network - my environment is a mesh of OS'.The first script is the delete script:------------------------------------------set targetpc=computer1set targetshare=sharedfilesREM Deletes the share.psexec "%targetpc%" net share "%targetshare%" /DELETE-------------------------------------------This works perfect.The second script is to re-establish the Share with the proper Share permission and NTFS permissions:------------------------------------------REM Sets NTFS permissions on the share To Full Control For Administrators and Change (Modify) For Users.psexec "%targetpc%" cmd /c echo y^|cacls "%targetdir%" /C /G administrators:Fpsexec "%targetpc%" cmd /c echo y^|cacls "%targetdir%" /E /C /G smsusers:Fpsexec "%targetpc%" cmd /c echo y^|cacls "%targetdir%" /E /C /G users:C------------------------------------------The problem exists with this second script. It creates the proper NTFS permissions (local group called SMSUSERS). However, it only creates Share permissions for Everyone with Read Only access. I'd like for the script to create Everyone with Read and Change access.Can this be done, if so how? Or, am I totally way off the mark? In other words, there is just NO way to do what I'm trying to do?Thanks very much.bird.
Creating permissions on a new share
Calcs can only set NTFS permissions. Take a look at SUBINACL to set the share permissions. You can download the tool from Microsoft.
Creating permissions on a new share
ok. Figured things out. I've done away with subinacl, and used rmtshare as a working substitute.thx.donald.
Creating permissions on a new share
I've used Rmtshare in the past and for working only with shares is certainly the better way to go. Subinacl can get pretty convoluted. Where did you find rmtshare? I don't think it is part of support tools or the resource kit.