473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Remove Inherited NTFS Folder Perms

I am trying to remove the inherited rights for the group Users at the
directory level \\server\share\directory.
Questions:
Why doesn't the code below work, or what would be a better/easier way
to do it?
Thanks,
Dan
Dim sec As New ADsSecurity
Dim sd As IADsSecurityDescriptor
Dim dacl As IADsAccessControlList
Dim ace As IADsAccessControlEntry

Set sec = CreateObject("ADsSecurity")
Set sd = sec.GetSecurityDescriptor("FILE://\\server\share\directory")
Set dacl = sd.DiscretionaryAcl

For Each ace In dacl
If ace.Trustee = "BUILTIN\Users" Then
Debug.Print "Trustee: " & vbtab & ace.Trustee
Debug.Print "AccessMask: " & vbtab & ace.AccessMask
Debug.Print "AceFlags: " & vbtab & ace.AceFlags
Debug.Print "AceType: " & vbtab & ace.AceType
Debug.Print "AceFlags: " & vbtab & ace.Flags
dacl.RemoveAce ace
End If

Next
sd.DiscretionaryAcl = dacl
sec.SetSecurityDescriptor sd
Jul 17 '05 #1
0 1301

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dan Crossett | last post by:
I am trying to remove the inherited rights for the group Users at the directory level \\server\share\directory. Questions: Why doesn't the code below work, or what would be a better/easier way to...
0
by: bart plessers | last post by:
Hello, I want to list my folders with ASP. I use following script to achieve this: Set oFSO = Server.CreateObject("Scripting.FileSystemObject") Set oRoot = oFSO.GetFolder(Path) Set oFolders =...
3
by: Pål Andreassen | last post by:
Running Windows 2003 Server Framework 1.1 A site is configured to use integrated security (in IIS 6) Windows autentication and user impersonation in web.config <identity impersonate="true" />...
0
by: HitSkiper | last post by:
I am getting the error "The security ID structure is invalid." When running this code. Sub SetPermissions(ByRef vPath As String, ByVal UserName As String) Dim objADsSec As ADsSecurity Dim...
10
by: Nancy Drew | last post by:
hi all i want to build a trouble ticket system. i'd like to have a component written in vbscript watch a specific mail folder for income email (something like 'troubletickets@acme.com') the...
1
by: BJS | last post by:
Hi there. I have been successfully running ASP on a W2K IIS5.0 server using Anon Access enabled, but would like to be able to restrict access to a particular folder containing some ASP content...
1
by: Sharon | last post by:
Hi all. How can i change a file NTFS permissions? 10x, Sharon.
1
by: Mohamed Zaki | last post by:
Dear All, I'm facing a strange problem, I've an ASP.NET web application that contains an admin folder, in this folder the access should be restricted to specific users, as i'm using windows...
4
by: Joey | last post by:
Hey, How can I add/edit/delete Folder NTFS permissions in .NET? I have a Win2K Box, and WMI is not installed on my servers Thanks ahead! -- Joey
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.