Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Setting share permissions from PowerShell?

Reply
 
Old 12-05-2008   #1 (permalink)
Chris Doherty


 
 

Setting share permissions from PowerShell?

Is there any simple way to modify share-level permissions in Windows
Server 2008 from within PowerShell? Please note I need to modify
share-level permissions, not the file system permissions, and I can't
use an external binary (like subinacl, rmtshare, setacl) to do it unless
that binary ships by default with Windows Server 2008.

I've found a handful of very old pre-1.0 PowerShell/Monad scripts that
claim to handle this using WMI, but they don't seem to work and my WMI
knowledge isn't sophisticated enough to handle this.

My System SpecsSystem Spec
Old 12-05-2008   #2 (permalink)
Vadims Podans


 
 

Re: Setting share permissions from PowerShell?

You can check this script at my former blog:
http://translate.google.com/translat...-8&sl=ru&tl=en

so, there is one error in line:
$ShareInfo += $ShareInfoNew
_ShareUtils_WriteShare $ShareInfoOld $shares

replace with:
$ShareInfo += $ShareInfoNew
_ShareUtils_WriteShare $ShareInfo $shares
--------
original link to post with script:
http://vpodans.spaces.live.com/blog/...E008!188.entry (in
russian)
and there is full share management with PowerShell (not the best, but this
is my first script with SecurityDescriptor)

To add share permission use example:
add-sharepermission "existing share name" everyone allow Change

for additional script support e-mail me to vpodans [at] sysadmins.lv
--
WBR, Vadims Podans
PowerShell blog - www.sysadmins.lv

"Chris Doherty" <christopher.doherty@xxxxxx> rakstīja ziņojumā
"news:ewT63ixVJHA.6116@xxxxxx"...
Quote:

> Is there any simple way to modify share-level permissions in Windows
> Server 2008 from within PowerShell? Please note I need to modify
> share-level permissions, not the file system permissions, and I can't use
> an external binary (like subinacl, rmtshare, setacl) to do it unless that
> binary ships by default with Windows Server 2008.
>
> I've found a handful of very old pre-1.0 PowerShell/Monad scripts that
> claim to handle this using WMI, but they don't seem to work and my WMI
> knowledge isn't sophisticated enough to handle this.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Share Permissions For Folders General Discussion
Re: Searching Network Share Permissions VB Script
Setting share permissions on a files server that does not support PowerShell
user permissions from local computer to network share Vista account administration
get permissions from share via wmi possible PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46