Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy security

Status
Not open for further replies.

adstam

Technical User
Feb 28, 2001
25
I have build an application in VB6 (using Activeds.dll from the ADSI25 resourcekit) that use this code to copy an ACL from one directory or file to another. It works fine on local drives but seems not to work on a networkshare (share is on a domaincontroller).
What am i doing wrong?

Sub CopySecurity(Sample, Target)
Dim sec As New ADsSecurity
Dim sdSample As IADsSecurityDescriptor
Dim sdTarget As IADsSecurityDescriptor
Dim dacl As IADsAccessControlList
Dim CopyDacl As IADsAccessControlList

Set sdSample = sec.GetSecurityDescriptor("FILE://" &
Sample)
Set sdTarget = sec.GetSecurityDescriptor("FILE://" &
Target)
Set dacl = sdSample.DiscretionaryAcl
Set CopyDacl = dacl.CopyAccessList

sdTarget.DiscretionaryAcl = CopyDacl
sec.SetSecurityDescriptor sdTarget
Set sdSample = Nothing
Set sdTarget = Nothing
Set dacl = Nothing
Set CopyDacl = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top