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

Changing NTFS Directory Security in .NET

P: n/a
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
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
http://msdn.microsoft.com/library/de...us/fileio/base
/file_security_and_access_rights.asp

Using Access Control
http://msdn.microsoft.com/library/de...us/security/se
curity/using_access_control.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/cpconconsumingunmanageddllfunctions.asp

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

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 discussion thread is closed

Replies have been disabled for this discussion.