Urgente: Como puedo crear una carpeta compartida
Publicado por Giovanny (1 intervención) el 23/05/2008 01:30:53
Hola!!
Saludos, necesito poder crear una carpeta pero con propiedades de compartida, encontre un ejemplo pero no entiendo algunas partes, ejemplo:
Dim share As IADsFileShare
Dim fshare As IADsFileService
Dim Fso As New FileSystemObject()
Dim sFolderPath As String
Dim Sec As New ADsSecurity()
Dim SD As IADsSecurityDescriptor
Dim Dacl As IADsAccessControlList
Dim newAce As New AccessControlEntry()
'------Create the folder usin FileSystemObject
sFolderPath = "server" & 'FolderToCreate'
Fso.CreateFolder("\" & sFolderPath)
'-------Create the share
fshare = GetObject("WinNT://server/Lanmanserver") <-que va aqui no entiendo esta parte.
share = fshare.Create("fileshare", Folder) <- la parte de folder no me queda clara
With share
.Path = "LocalPathOnServer" & sBrukernavn
.MaxUserCount = 10
.SetInfo()
End With
To set permissions on the share, use the IADSSecurity.dll with this code:
SD = Sec.GetSecurityDescriptor("FILE://\server" & Folder)
Ace = CreateObject("AccessControlEntry")
Dacl = SD.DiscretionaryAcl
newAce.Trustee = "Domain" & NameOfTheShare
newAce.AceType = 0
newAce.AceFlags = 3
Dacl.AddAce(newAce)
SD.DiscretionaryAcl = Dacl
Sec.SetSecurityDescriptor(SD)
Si algien pudiera ayudarme esto es muy urgente terminarlo =(
gracias.
Saludos, necesito poder crear una carpeta pero con propiedades de compartida, encontre un ejemplo pero no entiendo algunas partes, ejemplo:
Dim share As IADsFileShare
Dim fshare As IADsFileService
Dim Fso As New FileSystemObject()
Dim sFolderPath As String
Dim Sec As New ADsSecurity()
Dim SD As IADsSecurityDescriptor
Dim Dacl As IADsAccessControlList
Dim newAce As New AccessControlEntry()
'------Create the folder usin FileSystemObject
sFolderPath = "server" & 'FolderToCreate'
Fso.CreateFolder("\" & sFolderPath)
'-------Create the share
fshare = GetObject("WinNT://server/Lanmanserver") <-que va aqui no entiendo esta parte.
share = fshare.Create("fileshare", Folder) <- la parte de folder no me queda clara
With share
.Path = "LocalPathOnServer" & sBrukernavn
.MaxUserCount = 10
.SetInfo()
End With
To set permissions on the share, use the IADSSecurity.dll with this code:
SD = Sec.GetSecurityDescriptor("FILE://\server" & Folder)
Ace = CreateObject("AccessControlEntry")
Dacl = SD.DiscretionaryAcl
newAce.Trustee = "Domain" & NameOfTheShare
newAce.AceType = 0
newAce.AceFlags = 3
Dacl.AddAce(newAce)
SD.DiscretionaryAcl = Dacl
Sec.SetSecurityDescriptor(SD)
Si algien pudiera ayudarme esto es muy urgente terminarlo =(
gracias.
Valora esta pregunta


0