/build/static/layout/Breadcrumb_cap_w.png

Script to share a folder in a particular user group!

Hi All,
not sure whether am posting at the right place.
I want to create a script for sharing a folder for a particular user group.
The below given script shares the folder in all the user groups available.
Please suggest the required modification or provide me with a script to restrict it to a particular user group.
-----------------------------------------------------------------------
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:\Finance", "FinanceShare", FILE_SHARE, _
MAXIMUM_CONNECTIONS)
-----------------------------------------------------------------------------

Thanx in advance.

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 15 years ago
Red Belt
2
Hi, Shilpi.

- There is a 'Scripting' forum for this type of question;
- The CreateShare method does just that - it creates a share. If you want to add permissions to it, you need an appropriate tool. I believe our friend SetACL can apply permissions to shares, but don't quote me. Failing that, there is a WMI method. See http://cwashington.netreach.net/depo/view.asp?Index=1068 for details. A Google for 'VBScript +share +permissions' turned up that link, BTW.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ