473,474 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1671

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: Amit Desai | last post by:
Guys, I need to write a webcontrol that will allow the user to browse to a mapped folder or shared folder, check to see if they have access perms to the folder, and then convert the path to a fully...
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
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.