By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,878 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,878 IT Pros & Developers. It's quick & easy.

Changing NTFS Directory Security in .NET

P: n/a

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
Share this Question
Share on Google+
1 Reply

P: n/a
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

Using Access Control

HOWTO: Use ADSI to Set Automatic Inheritance of File/Folder Permissions

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

BTW, in the future, it would be best to post these questions in the
following newsgroup.

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

Have a nice day!


Microsoft Online Partner Support

Get Secure! C
This posting is provided as is with no warranties and confers no rights.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.