
|
email this FAQ to a colleague
Q:
How do I create a share using ADSI?
A:
Here is some vbscript that uses ADSI to create a fileshare.
' The name of the share.
strShareName = "MyShare"
' Machine should
Set objServer = GetObject("WinNT://Machine/lanmanserver")
' Match the machine where you want to create the share.
Set objNewShare = objfServer.Create("Fileshare", strShareName)
' The path you want the share to point to.
objsNewShare.Path = "c:\temp"
' Maximum number of users. Can be between 1 and 32767
objsNewShare.MaxUserCount = 10
objsNewShare.SetInfo
' Clean Up
Set objServer= Nothing
Set objNewShare = Nothing
- Mark L. Vanscoyk
|