I'm using the code below to set network sharing on a folder. However, by
default the share permissions give 'Everyone' full control. I want the group
to only have read permissions. I'm fairly new to scripting and don't really
know much about setting acl's, etc so the Win32_SecurityDescriptor msdn docs
are a bit confusing. Can anyone give me some pointers or examples on how i go
about doing this?

Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 25
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create ("C:\Sirius", "SIRIUS", FILE_SHARE,
MAXIMUM_CONNECTIONS)

Thanks very much.

Alex.

Re: setting permissions on network share by JHP

JHP
Fri Sep 15 11:28:59 CDT 2006

Freeware: http://setacl.sourceforge.net/

"lyon" <lyon@discussions.microsoft.com> wrote in message
news:005D39AC-8B87-4B69-BCAA-A4E0AE37F4DB@microsoft.com...
> I'm using the code below to set network sharing on a folder. However, by
> default the share permissions give 'Everyone' full control. I want the
> group
> to only have read permissions. I'm fairly new to scripting and don't
> really
> know much about setting acl's, etc so the Win32_SecurityDescriptor msdn
> docs
> are a bit confusing. Can anyone give me some pointers or examples on how i
> go
> about doing this?
>
> Const FILE_SHARE = 0
> Const MAXIMUM_CONNECTIONS = 25
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" &
> "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set objNewShare = objWMIService.Get("Win32_Share")
> errReturn = objNewShare.Create ("C:\Sirius", "SIRIUS", FILE_SHARE,
> MAXIMUM_CONNECTIONS)
>
> Thanks very much.
>
> Alex.
>
>