﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx<description>This post contains one example which shows how to deal with the Access Control Lists by using of .NET 2.0. It enlists all access rules from the specified folder. Additionally, this example shows how to remove the access control rule of the specified account</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>ACLs | Pearltrees</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1806282<pubdate>Fri, 12 May 2017 20:12:54 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1806282</guid><dc:creator>ACLs | Pearltrees</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;ACLs | Pearltrees&lt;/p&gt;
&lt;img src="http://developers.de/aggbug.aspx?PostID=1806282" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#191821<pubdate>Wed, 12 Oct 2011 08:14:48 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:191821</guid><dc:creator>Camille Le Mouëllic</dc:creator><description>&lt;p&gt;Hi Ric, Paul,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve wrote a post on &amp;nbsp;the different Security Descriptors&amp;#39; Inheritance and Propagation file possibilities, including &amp;quot;File Only&amp;quot;&lt;/p&gt;
&lt;p&gt;Have a check:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://camillelemouellic.blog.com/2011/07/22/powershell-security-descriptors-inheritance-and-propagation-flag-possibilities/"&gt;camillelemouellic.blog.com/.../powershell-security-descriptors-inheritance-and-propagation-flag-possibilities&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(It&amp;#39;s aimed at Powershell, but it&amp;#39;s using .NET all the same, it might prove useful to you).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=191821" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#28464<pubdate>Wed, 08 Dec 2010 13:52:09 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:28464</guid><dc:creator>Paul Bergson</dc:creator><description>&lt;p&gt;I also needed &amp;quot;File Only&amp;quot; and after a whole bunch of playing I started dumping the access property:&lt;/p&gt;
&lt;p&gt;Get-Acl fileLocation |select -ExpandProperty access&lt;/p&gt;
&lt;p&gt;This allowed me to make comparisons and I found that by the following two settings I was able to get things to work:&lt;/p&gt;
&lt;p&gt;$InheritanceFlag = &amp;quot;ObjectInherit&amp;quot;&lt;/p&gt;
&lt;p&gt;$PropagationFlag = &amp;quot;InheritOnly&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=28464" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#278910<pubdate>Thu, 28 May 2009 22:51:16 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:278910</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;Nevermind, maybe it was a silly question but I figured it out:&lt;/p&gt;
&lt;p&gt;(InheritanceFlags.ObjectInherit), PropagationFlags.InheritOnly&lt;/p&gt;
&lt;p&gt;Thanks again for the nice article. It really did help!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=278910" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#5588<pubdate>Wed, 27 May 2009 18:20:58 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:5588</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;I see this is an old thread but a great article and the chart above has proven to be very helpful. &lt;/p&gt;
&lt;p&gt;I was wondering though it there is a &amp;quot;FILES ONLY&amp;quot; setting?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=5588" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1882<pubdate>Mon, 14 Apr 2008 15:21:26 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1882</guid><dc:creator>Resimler</dc:creator><description>&lt;p&gt;thank you Damir Dobric.This is very good information,I like this blog,thanx your time and effort.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1882" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1523<pubdate>Thu, 30 Aug 2007 13:08:11 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1523</guid><dc:creator>daree</dc:creator><description>&lt;p&gt;Thanks for your prompt help Damir, i was just wondering because it works well with application but the same thing doesn't work with Windows Service.&lt;/p&gt;
&lt;p&gt;i will try out few more techniques may be i'm missing out something.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1523" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1522<pubdate>Thu, 30 Aug 2007 13:03:05 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1522</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;If that account has not permission to the folder, then it will not work?!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1522" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1520<pubdate>Thu, 30 Aug 2007 12:45:22 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1520</guid><dc:creator>daree</dc:creator><description>&lt;p&gt;it is running as system&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1520" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1519<pubdate>Thu, 30 Aug 2007 12:43:29 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1519</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;It seems that the user under the service is running has different permissions than the interactive user (you), who starts the application. I would check the permissions of the user running the service (System, LocalService, Network Service etc.).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1519" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1518<pubdate>Thu, 30 Aug 2007 12:35:10 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1518</guid><dc:creator>daree</dc:creator><description>&lt;p&gt;thanks Damir,&lt;/p&gt;
&lt;p&gt;My actual problem is, lets say if i remove all the security from the directory, the program cant get the access control for that particular folder (when i run my program as a windows service). however, if i create an application and run the code it works fine. it is because windows Service cant get the access control for any directory? &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1518" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1517<pubdate>Thu, 30 Aug 2007 12:10:05 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1517</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;I’m not sure what your problem is. However, It could be that the operative system you use is not the English one. For example on the German system there is no group “everyone”. That group is called in German “jeder”.&lt;/p&gt;
&lt;p&gt;Try to use the generic naming of groups and not hard coded names.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1517" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1516<pubdate>Thu, 30 Aug 2007 11:51:21 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1516</guid><dc:creator>daree</dc:creator><description>&lt;p&gt;i compiled the exact same code in Windows Service, it doesn't work. somhow it crash in like DirectorySecurity dirSec = Directory.GetAccessControl(dir);&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1516" width="1" height="1"&gt;</description></item><item><title>&amp;raquo; PowerShell: Set-Acl Does Not Appear to Work</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1457<pubdate>Sat, 28 Jul 2007 22:07:00 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1457</guid><dc:creator>» PowerShell: Set-Acl Does Not Appear to Work</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;&amp;amp;raquo; PowerShell: Set-Acl Does Not Appear to Work&lt;/p&gt;
&lt;img src="http://developers.de/aggbug.aspx?PostID=1457" width="1" height="1"&gt;</description></item><item><title>re: Directory Security and Access Rules</title><link />http://developers.de/blogs/damir_dobric/archive/2007/06/18/directory-security-and-access-rules.aspx#1447<pubdate>Mon, 23 Jul 2007 06:46:20 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1447</guid><dc:creator>Chrissy</dc:creator><description>&lt;p&gt;That list contained exactly what I needed to know! Thank you!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1447" width="1" height="1"&gt;</description></item></channel></rss>