look for a library called <ADsSecurity.dll> in
msdn.microsoft.com/google.com;
this will do your job (add/edit/remove permissions on security objects (like
users/folders/files/printers) )
and it's usable from .NET too:
string _udir = rootFolder + folder;
ADsSecurity _adSec = new ADsSecurity();
IADsSecurityDescriptor _sd =
(IADsSecurityDescriptor)_adSec.GetSecurityDescript or("FILE://"+_udir );
IADsAccessControlList _dacl =
(IADsAccessControlList)_sd.DiscretionaryAcl;
_sd.Control =
(int)ActiveDs.ADS_SD_CONTROL_ENUM.ADS_SD_CONTROL_S E_DACL_PROTECTED;
ActiveDs.AccessControlEntry _ace3 = new ActiveDs.AccessControlEntry();
_ace3.Trustee = <YOUR_USER_NAME>;
//_ace3.Trustee="Internet Guest Account";
_ace3.AccessMask =
(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_GENERIC_EX ECUTE
|(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_GENERIC_R EAD
|(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_READ_CONT ROL
|(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_SYNCHRONI ZE
|(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_GENERIC_W RITE
|(int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_GENERIC_E XECUTE;
_ace3.AceType =
(int)ActiveDs.ADS_ACETYPE_ENUM.ADS_ACETYPE_ACCESS_ ALLOWED;
_ace3.AceFlags =
(int)ActiveDs.ADS_ACEFLAG_ENUM.ADS_ACEFLAG_INHERIT _ACE|1;
_dacl.AddAce(_ace3);
//
_sd.DiscretionaryAcl = _dacl;
_adSec.SetSecurityDescriptor(_sd,"FILE://"+ _udir);
HTH,
Daniel
"Ram" <ni***@bezeqint.net> wrote in message
news:eb**************@tk2msftngp13.phx.gbl...
Hey,
I'v managed to find a way of adding NTFS permissions to a certain folder,
But the problem is, the folder has a couple of inherited permissions which
I want to delete.
How can I remove the folder's NTFS permissions WITHOUT using WMI or
special XP features?
Thanks ahead!
--Ram