E
Eric.beaumard
Hi
Under windows XP pro 2003 server, with administer rigths, with Access
2003 and VBA. I've
a function named "createShare" that create shares on a folder
("dossier").
It works fine when with a local folder, but none at all with a remote
folder
on a distant computer (the folder is not shared). I use UNC path.
What is the problem ?
Eric
Public Sub createShare(dossier, login, commentaire As String)
Const droitCT = 2032127 'Controle Total
Const droitRW = 1245631 'Lecture-Ecriture
Const droitR = 1179817 'Lecture
'Création d'une nouvelle instance de l'objet
Win32_SécurityDescriptor
Set objSecDescriptor =
GetObject("Winmgmts:Win32_SecurityDescriptor").SpawnInstance_()
objSecDescriptor.Properties_.Item("ControlFlags") = 4
Set aceAdmin = getACE("Admins du domaine", 2032127)
'Création de la sécurité ACE pour le groupe 'group1' avec
des droits en RW
Set ace2 = getACE(login, droitRW)
'Ajout des sécurités à l'objet sécurity descriptor
objSecDescriptor.Properties_.Item("DACL") = Array(aceAdmin,
ace2)
'Création du partage
Set objShare = GetObject("Winmgmts:Win32_Share")
Set objInParam =
objShare.Methods_("Create").InParameters.SpawnInstance_()
objInParam.Properties_.Item("Access") = objSecDescriptor
objInParam.Properties_.Item("Description") = commentaire
objInParam.Properties_.Item("Name") = login & "$"
objInParam.Properties_.Item("Path") = dossier
objInParam.Properties_.Item("Type") = 0
Set objOutParams = objShare.ExecMethod_("Create", objInParam)
End Sub
..
Under windows XP pro 2003 server, with administer rigths, with Access
2003 and VBA. I've
a function named "createShare" that create shares on a folder
("dossier").
It works fine when with a local folder, but none at all with a remote
folder
on a distant computer (the folder is not shared). I use UNC path.
What is the problem ?
Eric
Public Sub createShare(dossier, login, commentaire As String)
Const droitCT = 2032127 'Controle Total
Const droitRW = 1245631 'Lecture-Ecriture
Const droitR = 1179817 'Lecture
'Création d'une nouvelle instance de l'objet
Win32_SécurityDescriptor
Set objSecDescriptor =
GetObject("Winmgmts:Win32_SecurityDescriptor").SpawnInstance_()
objSecDescriptor.Properties_.Item("ControlFlags") = 4
Set aceAdmin = getACE("Admins du domaine", 2032127)
'Création de la sécurité ACE pour le groupe 'group1' avec
des droits en RW
Set ace2 = getACE(login, droitRW)
'Ajout des sécurités à l'objet sécurity descriptor
objSecDescriptor.Properties_.Item("DACL") = Array(aceAdmin,
ace2)
'Création du partage
Set objShare = GetObject("Winmgmts:Win32_Share")
Set objInParam =
objShare.Methods_("Create").InParameters.SpawnInstance_()
objInParam.Properties_.Item("Access") = objSecDescriptor
objInParam.Properties_.Item("Description") = commentaire
objInParam.Properties_.Item("Name") = login & "$"
objInParam.Properties_.Item("Path") = dossier
objInParam.Properties_.Item("Type") = 0
Set objOutParams = objShare.ExecMethod_("Create", objInParam)
End Sub
..