473,788 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing NTFS Directory Security in .NET

Hi,

Using VB.NET I need to access a shared drive on a server
using a specific account, check for a subdirectory, add it
if it doesn't exist and then change the access security
for the subdirectory to only allow specific accounts to
access it - these will be different to the account used by
the app.

Thanks for your help.
Jul 19 '05 #1
1 3034
Hello Duncan,

Thanks for your post. I'd like to share the following information with you:

1. You will need to use Access Control functions to add a DACL with an
access-allowed ACE to a folder's security descriptor. I believe the
following MSDN articles are helpful:

File Security and Access Rights
http://msdn.microsoft.com/library/de...us/fileio/base
/file_security_a nd_access_right s.asp

Using Access Control
http://msdn.microsoft.com/library/de...us/security/se
curity/using_access_co ntrol.asp?frame =true

HOWTO: Use ADSI to Set Automatic Inheritance of File/Folder Permissions
http://support.microsoft.com/?id=266461

2. As you know, the Access Control functions are native APIs. If you want
to call them in you Visual Basic .NET application, you need to use Platform
Invoke as described below:

Consuming Unmanaged DLL Functions
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconconsumingu nmanageddllfunc tions.asp

BTW, in the future, it would be best to post these questions in the
following newsgroup.
Microsoft.publi c.platformsdk.s ecurity

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Jul 19 '05 #2

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

Similar topics

1
8034
by: BingoHandJob | last post by:
Hello group! I'm having a problem and I hope some of you may be able to point me in the right direction. I inherited a web site using php, running on Windows 2000 & IIS. The site was developed by a consulting firm about a year before I came on board, the consultant has since gone out of business. Overall, I've never had a problem with the site and have been able to figure out nearly everything they configured on it.
0
2724
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 = oRoot.SubFolders for Each oFolder in oFolders Response.Write FolderDisplayName next
3
453
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" /> <authentication mode="Windows" /> I've got a ASPX page that lists folders and files from a predefined location on the server. These folders and files have access rights set to
4
5013
by: Mark A. Richman | last post by:
I'm using the new System.Security.AccessControl stuff in 2.0. This is a snippet typical of what I've done (this example sets Read access for Network Service on 'myFolder' and all subfolders and files) SecurityIdentifier siNetworkService = new SecurityIdentifier(WellKnownSidType.NetworkServiceSid, null); NTAccount ntaNetworkService = siNetworkService.Translate(typeof(NTAccount)) as NTAccount; DirectoryInfo diMyFolder = new...
9
10904
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
0
1337
by: VP | last post by:
Hi there, well i am stuck on a problem with regards to obtaining security permissions on folders. At the moment I have created a simple treeview example which shows all sub-directories in a tree form for a particular directory. Then I wanted to see how the application would handle a sub-directory(test1) if the current user logged on win2k box didnt have the permissions to access test1. The application throws an exception
0
935
by: Eddie B | last post by:
Hello all, I am writing an aspx (Visual Basic) logon app for a friend (he needs to be able to reset expired passwords, so the regular windows logon won't work). Everything is in the same domain and secure, so that isn't really going to be a problem. I created a logon page, that checks user name and password against active directory:
1
274
by: Duncan Allen | last post by:
Hi, Using VB.NET I need to access a shared drive on a server using a specific account, check for a subdirectory, add it if it doesn't exist and then change the access security for the subdirectory to only allow specific accounts to access it - these will be different to the account used by the app. Thanks for your help.
0
1185
by: David Rees | last post by:
Hi I've got a series of NTFS Directories which have permission inheritance unchecked (in Explorer) with a bunch of permissions explicitly stated, and I need to remove these explicit permissions and allow permissions from the parent directory to propagate through (i.e. check the "Inherit from parent the permission entries that apply to child objects." checkbox within code) Thing is, I can't figure out how to use the DirectorySecurity...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.