473,385 Members | 1,693 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.

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 2994
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
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...
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" />...
4
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...
9
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...
0
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...
0
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...
1
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...
0
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...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.