Re: adding share permissions via a batch file
From: Herb Martin (news_at_LearnQuick.com)
Date: 03/06/05
- Next message: Lanwench [MVP - Exchange]: "Re: Logon Banner Problem"
- Previous message: Herb Martin: "Re: Logon Banner Problem"
- In reply to: Nathan H: "adding share permissions via a batch file"
- Next in thread: Nathan H: "Re: adding share permissions via a batch file"
- Reply: Nathan H: "Re: adding share permissions via a batch file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 5 Mar 2005 21:54:09 -0600
"Nathan H" <annonymous@discussions.microsoft.com> wrote in message
news:OAXCMEfIFHA.276@tk2msftngp13.phx.gbl...
> Hi all
> It may have been covered before and I apologize if it has but does
> anyone know a way of assigning full *share* permissions to the user you
> are creating via a batch file?
Sure but that is generally the wrong approach.
(Depends on the OS whether it is built in or
not, but even then you can use the free SetAcl.exe
from SourceForge.net.)
> i.e.
> I create the folder \\servername\%username%$ (for the users home dir)
Usually permissions should be handled by groups,
and each user should NOT have a separate share
but only a directory within the share for groups of
users, (e.g., all Engineers or even all users.)
> Now, I can assign the NTFS permissions fine with cacls like this (as an
> example):
> cacls d:\homedir\%username% /t /e /c /g %username%:f
>
> (don't worry about the above syntax - I've had a few drinks hehe)
>
> I just cant seem to find a way of assigning share permissions using any
> sort of command.
Share permissions were added to "net share" in
Win2003 server but SetAcl.exe can still set them
for older operating systems.
Caveat: SetAcl has the most irrating command line
of any Windows utility I know.
> As the script is so I can process a list of user's to add, it's a little
> annoying after adding a load of users to a AD which has worked fine -
> having to go and manually change each of the share permissions from:
> Everyone - Read Only
> to:
> Everyone - Full Control
And that is likely a poor choice for permissions,
especially since you were creating these for each
user.
> (i don't want a discussion on whether this is right or wrong however -
> just a way of doing it using some command line tool in a normal bat/cmd
> scripted way)
If you ask you get the whole answer since it would
mislead others to tell you how to do something without
giving the full story.
> Many thanks to anyone that can give me a hand with this :)
SetAcl.exe
-- Herb Martin > > Regards, > Nathan H. > Network Administrator - Ysgol Bro Ddyfi (Edu)
- Next message: Lanwench [MVP - Exchange]: "Re: Logon Banner Problem"
- Previous message: Herb Martin: "Re: Logon Banner Problem"
- In reply to: Nathan H: "adding share permissions via a batch file"
- Next in thread: Nathan H: "Re: adding share permissions via a batch file"
- Reply: Nathan H: "Re: adding share permissions via a batch file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|