{"id":52473,"date":"2009-09-14T03:01:00","date_gmt":"2009-09-14T03:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2009\/09\/14\/hey-scripting-guy-can-i-determine-a-folders-access-rights-and-who-has-them\/"},"modified":"2009-09-14T03:01:00","modified_gmt":"2009-09-14T03:01:00","slug":"hey-scripting-guy-can-i-determine-a-folders-access-rights-and-who-has-them","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-can-i-determine-a-folders-access-rights-and-who-has-them\/","title":{"rendered":"Hey, Scripting Guy! Can I Determine a Folder&#8217;s Access Rights and Who Has Them?"},"content":{"rendered":"<p><span class=\"sbmLink\">   <\/p>\n<table cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td class=\"sbmText\">Share this post: <\/td>\n<td><a title=\"Post it to Backflip!\" href=\"http:\/\/www.backflip.com\/add_page_pop.ihtml?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/backflip4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Buddymark!\" href=\"http:\/\/buddymarks.com\/s_add_bookmark.php?bookmark_url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;bookmark_title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/buddymar4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Del.icio.us!\" href=\"http:\/\/del.icio.us\/post?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/deliciou4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Digg!\" href=\"http:\/\/digg.com\/submit?phase=2&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/digg14.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Facebook!\" href=\"http:\/\/www.facebook.com\/sharer.php?u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;t=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/telligent.evolution.components.attachments\/13\/4982\/00\/00\/01\/76\/53\/19\/facebook.JPG\" \/><\/a><\/td>\n<td><a title=\"Post it to Furl!\" href=\"http:\/\/www.furl.net\/store?s=f&amp;to=0&amp;u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;ti=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/furl4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Netvouz!\" href=\"http:\/\/netvouz.com\/action\/submitBookmark?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/netvouz4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Reddit!\" href=\"http:\/\/reddit.com\/submit?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/reddit4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Spurl!\" href=\"http:\/\/www.spurl.net\/spurl.php?v=3&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/spurl8.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Technorati!\" href=\"http:\/\/technorati.com\/faves\/?add=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/technora4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Wists!\" href=\"http:\/\/www.wists.com\/?action=add&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;title=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/wists9.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Yahoo!\" href=\"http:\/\/myweb.yahoo.com\/myresults\/bookmarklet?u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/14\/hey-scripting-guy-september-14-2009.aspx&amp;t=Hey, Scripting Guy! Can I Determine a Folder's Access Rights and Who Has Them?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/yahoo9.png\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> <\/span>  <\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\"><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hey, Scripting Guy! I am trying to get a handle around the security of a folder on my computer. I need to be able to figure out a way to determine who has access and what those access rights are. I guess I could use the <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc753525(WS.10).aspx\"><font face=\"Segoe\">Icacls utility<\/font><\/a>, but I prefer to use something that is native to Windows PowerShell so that I can work with the objects that are returned and not have to waste a bunch of time parsing text. <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">&#8212; BH <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\"><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hello BH, <\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. If you have friended me on Facebook, you know that today is my birthday. I am at the point where having a birthday is not necessarily a cause for celebration\u2014the Scripting Wife has not made me a cake and ice cream or invited my friends over for a party. At least not in the last couple of years. But still, I would rather have a birthday than not have a birthday so I am in a good mood. In addition, with the Scripting Wife, one never knows what she may have up her sleeve for the occasion. <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">Back to your question. If you do not want to use the Icacls utility because it is not native to Windows PowerShell, the best tool to use to work with security on a folder is the Windows PowerShell <b>Get-Acl<\/b> cmdlet. When you use the <b>Get-Acl<\/b> cmdlet and give it the path to a folder, it returns an instance of the <b>System.Security.AccessControl.DirectorySecurity<\/b> object, which is <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.security.accesscontrol.directorysecurity.aspx\"><font face=\"Segoe\">documented on MSDN<\/font><\/a> and is used to represent the access control and the audit security for a directory. It specifies the access rights for a directory and how access attempts are audited. The class represents each of the access and audit rights as a set of rules. The access rules are presented as instances of the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.security.accesscontrol.filesystemaccessrule.aspx\"><font face=\"Segoe\">System.Security.AccessControl.FileSystemAccessRule<\/font><\/a> object and the audit rules are presented as instances of the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.security.accesscontrol.filesystemauditrule.aspx\"><font face=\"Segoe\">System.Security.AccessControl.FileSystemAuditRule<\/font><\/a> class. <span>&#160;<\/span> <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">To retrieve the <b>DirectorySecurity<\/b> object using the <b>Get-Acl<\/b> cmdlet, you specify the path to the folder via the <b>path<\/b> parameter. This is seen here: <b><\/b><\/p>\n<\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Acl -Path C:\\fso        <\/p>\n<p><span>&#160;&#160;&#160; <\/span>Directory: C:\\         <\/p>\n<p>Path<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Owner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Access         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8211;<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;         <br \/>fso<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Administrators<span>&#160;&#160;&#160;&#160; <\/span>NWTRADERS\\Administrato&#8230;         <\/p>\n<p>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">You can see from the output that the <b>Owner<\/b> property is returned. The <b>Access<\/b> property is truncated and does not display all of the users who have access to the folder. You might decide to pipe the results to the <b>Select-Object<\/b> cmdlet and choose the <b>Access<\/b> property. When you use this technique, as seen here, the <b>Access<\/b> control information is still truncated: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Acl -Path C:\\fso | select-object access        <\/p>\n<p>Access         <br \/>&#8212;&#8212;         <br \/>{System.Security.AccessControl.FileSystemAccessRule, System.Security.AccessC&#8230;         <\/p>\n<p>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">If you pipe the result of the <b>Select-Object<\/b> cmdlet to the <b>Format-List<\/b> cmdlet and choose all of the properties, you will finally be able to see all of the information returned from the <b>Access<\/b> property. As seen here, however, the results are not what might be expected: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Acl -Path C:\\fso | select-object access | Format-List *        <\/p>\n<p>Access : {System.Security.AccessControl.FileSystemAccessRule, System.Security.A         <br \/><span>&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160;&#160; <\/span>ccessControl.FileSystemAccessRule, System.Security.AccessControl.FileS         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>ystemAccessRule, System.Security.AccessControl.FileSystemAccessRule&#8230;         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>}         <\/p>\n<p>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">To retrieve a list of the users who have access to the folder, you need to use the <b>accessToString<\/b> property because the access rights to the folder is stored as a series of <b>FileSystemAccessRules<\/b>. After you have piped the results to the <b>Format-List<\/b> cmdlet, you no longer have a <b>DirectorySecurity<\/b> object. You have a formatted textual representation of the underlying object. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Acl -Path C:\\fso | Format-List AccessToString        <\/p>\n<p>AccessToString : NWTRADERS\\Administrator Allow<span>&#160; <\/span>FullControl         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Administrators Allow<span>&#160; <\/span>FullControl         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Administrators Allow<span>&#160; <\/span>268435456         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NT AUTHORITY\\SYSTEM Allow<span>&#160; <\/span>FullControl         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NT AUTHORITY\\SYSTEM Allow<span>&#160; <\/span>268435456         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Users Allow<span>&#160; <\/span>ReadAndExecute, Synchronize         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NT AUTHORITY\\Authenticated Users Allow<span>&#160; <\/span>Modify, Synchronize         <br \/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NT AUTHORITY\\Authenticated Users Allow<span>&#160; <\/span>-536805376 <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">If you wish to write to a text file the list of people who have access to the folder, the above formatted list is quite acceptable. To write the users who have access to a text file, you can use the <b>Out-File<\/b> cmdlet as seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Acl -Path C:\\fso | Format-List accessToString |        <br \/>Out-File -FilePath c:\\fso\\fsoAcl.txt -Append         <br \/>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">When the above command is run, the following text file is seen: <\/p>\n<\/p>\n<p style=\"margin: 9pt 0in 4pt\" class=\"Fig-Graphic\">\n<p><img decoding=\"async\" style=\"width: 600px;height: 353px\" title=\"Image of text file displayed when command is run\" alt=\"Image of text file displayed when command is run\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/september\/hey0914\/hsg-09-14-09-01.jpg\" width=\"600\" height=\"353\" \/>     <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">If you prefer to work with the folder in a more direct manner, you can use the <b>Get-Acl<\/b> cmdlet to retrieve the <b>DirectorySecurity<\/b> object, and you can store it in a variable. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl = Get-Acl -Path C:\\fso        <br \/>PS C:\\&gt; $acl         <\/p>\n<p><span>&#160;&#160;&#160; <\/span>Directory: C:\\         <\/p>\n<p>Path<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Owner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Access         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8211;<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;         <br \/>fso<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Administrators<span>&#160;&#160;&#160;&#160; <\/span>NWTRADERS\\Administrato&#8230;         <\/p>\n<p>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">After you have the <b>DirectorySecurity<\/b> object stored in a variable, you can work directly with the underlying objects. This is shown here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt\" class=\"CodeBlock\"><font face=\"Lucida Sans Typewriter\"><span style=\"background: #f2f2f2;font-size: 9.5pt\">PS C:\\&gt; $acl = Get-Acl -Path C:\\fso        <br \/>PS C:\\&gt; $acl         <\/p>\n<p><span>&#160;&#160;&#160; <\/span>Directory: C:\\         <\/p>\n<p>Path<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Owner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Access         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8211;<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;         <br \/>fso<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>BUILTIN\\Administrators<span>&#160;&#160;&#160;&#160; <\/span>NWTRADERS\\Administrato&#8230;         <\/p>\n<p><\/span><span style=\"font-size: 9.5pt\"><\/span><\/font>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">To examine the methods and properties that are available from the object we have stored in the <b>$acl <\/b>variable, we use the <b>Get-Member<\/b> cmdlet. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl | Get-Member        <\/p>\n<p><span>&#160;&#160; <\/span>TypeName: System.Security.AccessControl.DirectorySecurity         <\/p>\n<p>Name<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>MemberType<span>&#160;&#160;&#160;&#160; <\/span>Definition         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;&#8212;-<span>&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;&#8212;-         <br \/>Access <span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>CodeProperty<span>&#160;&#160; <\/span>System.Security.AccessControl&#8230;         <br \/>Group<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>CodeProperty<span>&#160;&#160; <\/span>System.String Group{get=GetGr&#8230;         <br \/>Owner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>CodeProperty<span>&#160;&#160; <\/span>System.String Owner{get=GetOw&#8230;         <br \/>Path<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>CodeProperty<span>&#160;&#160; <\/span>System.String Path{get=GetPath;}         <br \/>Sddl<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>CodeProperty<span>&#160;&#160; <\/span>System.String Sddl{get=GetSddl;}         <br \/>AccessRuleFactory<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.AccessControl&#8230;         <br \/>AddAccessRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method <span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void AddAccessRule(Sys&#8230;         <br \/>AddAuditRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void AddAuditRule(Syst&#8230;         <br \/>AuditRuleFactory<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.AccessControl&#8230;         <br \/>Equals<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>bool Equals(System.Object obj)         <br \/>GetAccessRules<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.AccessControl&#8230;         <br \/>GetAuditRules<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.AccessControl&#8230;         <br \/>GetGroup<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.Principal.Ide&#8230;         <br \/>GetHashCode<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>int GetHashCode()         <br \/>GetOwner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Security.Principal.Ide&#8230;         <br \/>GetSecurityDescriptorBinaryForm Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>byte[] GetSecurityDescriptorB&#8230;         <br \/>GetSecurityDescriptorSddlForm<span>&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>string GetSecurityDescriptorS&#8230;         <br \/>GetType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>type GetType()         <br \/>ModifyAccessRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>bool ModifyAccessRule(System&#8230;.         <br \/>ModifyAuditRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>bool ModifyAuditRule(System.S&#8230;         <br \/>PurgeAccessRules<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void PurgeAccessRules(&#8230;         <br \/>PurgeAuditRules<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void PurgeAuditRules(S&#8230;         <br \/>RemoveAccessRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>bool RemoveAccessRule(System&#8230;.         <br \/>RemoveAccessRuleAll<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void RemoveAccessRuleA&#8230;         <br \/>RemoveAccessRuleSpecific<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void RemoveAccessRuleS&#8230;         <br \/>RemoveAuditRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>bool RemoveAuditRule(System.S&#8230;         <br \/>RemoveAuditRuleAll<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void RemoveAuditRuleAl&#8230;         <br \/>RemoveAuditRuleSpecific<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void RemoveAuditRuleSp&#8230;         <br \/>ResetAccessRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void ResetAccessRule(S&#8230;         <br \/>SetAccessRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetAccessRule(Sys&#8230;         <br \/>SetAccessRuleProtection<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetAccessRuleProt&#8230;         <br \/>SetAuditRule<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetAuditRule(Syst&#8230;         <br \/>SetAuditRuleProtection<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160;&#160; <\/span>System.Void SetAuditRuleProte&#8230;         <br \/>SetGroup<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetGroup(System.S&#8230;         <br \/>SetOwner<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetOwner(System.S&#8230;         <br \/>SetSecurityDescriptorBinaryForm Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetSecurityDescri&#8230;         <br \/>SetSecurityDescriptorSddlForm<span>&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Void SetSecurityDescri&#8230;         <br \/>ToString<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>string ToString()         <br \/>PSChildName<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NoteProperty<span>&#160;&#160; <\/span>System.String PSChildName=fso         <br \/>PSDrive<span>&#160;&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NoteProperty<span>&#160;&#160; <\/span>System.Management.Automation&#8230;.         <br \/>PSParentPath<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NoteProperty<span>&#160;&#160; <\/span>System.String PSParentPath=Mi&#8230;         <br \/>PSPath<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>NoteProperty<span>&#160;&#160; <\/span>System.String PSPath=Microsof&#8230;         <br \/>PSProvider<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span><span>&#160;&#160;&#160; <\/span>NoteProperty<span>&#160;&#160; <\/span>System.Management.Automation&#8230;.         <br \/>AccessRightType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Type AccessRightType {&#8230;         <br \/>AccessRuleType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Type AccessRuleType {g&#8230;         <br \/>AreAccessRulesCanonical<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160; <\/span><span>&#160;&#160; <\/span>System.Boolean AreAccessRules&#8230;         <br \/>AreAccessRulesProtected<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Boolean AreAccessRules&#8230;         <br \/>AreAuditRulesCanonical<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Boolean AreAuditRulesC&#8230;         <br \/>AreAuditRulesProtected<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Boolean AreAuditRulesP&#8230;         <br \/>AuditRuleType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>System.Type AuditRuleType {get;}         <br \/>AccessToString<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>ScriptProperty System.Object AccessToString &#8230;         <br \/>AuditToString<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>ScriptProperty System.Object AuditToString {&#8230; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">The <b>Access <\/b>property is a <b>codeproperty<\/b>. This means it was added by the Windows PowerShell team. To see what you can do with the <b>Access<\/b> property, pipe it to the <b>Get-Member<\/b> cmdlet. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access | Get-Member        <\/p>\n<p><span>&#160;&#160; <\/span>TypeName: System.Security.AccessControl.FileSystemAccessRule         <\/p>\n<p>Name<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>MemberType Definition         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-         <br \/>Equals<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>bool Equals(System.Object obj)         <br \/>GetHashCode<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>int GetHashCode()         <br \/>GetType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>type GetType()         <br \/>ToString<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>string ToString()         <br \/>AccessControlType Property<span>&#160;&#160; <\/span>System.Security.AccessControl.AccessControlType&#8230;         <br \/>FileSystemRights<span>&#160; <\/span>Property<span>&#160;&#160; <\/span>System.Security.AccessControl.FileSystemRights &#8230;         <br \/>IdentityReference Property<span>&#160; <\/span><span>&#160;<\/span>System.Security.Principal.IdentityReference Ide&#8230;         <br \/>InheritanceFlags<span>&#160; <\/span>Property<span>&#160;&#160; <\/span>System.Security.AccessControl.InheritanceFlags &#8230;         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160; <\/span>System.Boolean IsInherited {get;}         <br \/>PropagationFlags<span>&#160; <\/span>Property<span>&#160;&#160; <\/span>System.Security.AccessControl.PropagationFlags &#8230;         <\/p>\n<p>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">The <b>Access<\/b> property returns an instance of the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.security.accesscontrol.filesystemaccessrule.aspx\"><font face=\"Segoe\">System.Security.AccessControl.FileSystemAccessRule<\/font><\/a> .NET Framework class. When you look at the <b>Access<\/b> property, it displays the following information: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access        <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: FullControl         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NWTRADERS\\Administrator         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: False         <br \/>InheritanceFlags <span>&#160;<\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: None         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: FullControl         <br \/>AccessControlType : Allow         <br \/>IdentityReference : BUILTIN\\Administrators         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: None         <br \/>PropagationFlags<span>&#160; <\/span>: None         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: 268435456         <br \/>AccessControlType : Allow         <br \/>IdentityReference : BUILTIN\\Administrators         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: InheritOnly         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: FullControl         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NT AUTHORITY\\SYSTEM         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: None         <br \/>PropagationFlags<span>&#160; <\/span>: None         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: 268435456         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NT AUTHORITY\\SYSTEM         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: InheritOnly         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: ReadAndExecute, Synchronize         <br \/>AccessControlType : Allow         <br \/>IdentityReference : BUILTIN\\Users         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: None         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: Modify, Synchronize         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NT AUTHORITY\\Authenticated Users         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: None         <br \/>PropagationFlags<span>&#160; <\/span>: None         <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: -536805376         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NT AUTHORITY\\Authenticated Users         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True         <br \/>InheritanceFlags<span>&#160; <\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: InheritOnly <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">\n<p>&#160;<\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">Because the <b>System.Security.AccessControl.FileSystemAuditRule<\/b> class is returned as a collection, you can index directly into it. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt\" class=\"CodeBlock\"><span style=\"background: #f2f2f2;font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access[0]        <\/p>\n<p>FileSystemRights<span>&#160; <\/span>: FullControl         <br \/>AccessControlType : Allow         <br \/>IdentityReference : NWTRADERS\\Administrator         <br \/>IsInherited<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: False         <br \/>InheritanceFlags<span>&#160; <\/span>: ContainerInherit, ObjectInherit         <br \/>PropagationFlags<span>&#160; <\/span>: None<\/font><\/span><span style=\"font-size: 9.5pt\">      <\/p>\n<p><\/span><\/p>\n<\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">The <b>IdentityReference<\/b> property returns an instance of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.security.principal.ntaccount.aspx\"><font face=\"Segoe\">System.Security.Principal.NTAccount<\/font><\/a> .NET Framework class. The members of this object are seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt\" class=\"CodeBlock\"><span style=\"background: #f2f2f2;font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access[0].identityReference | Get-Member        <\/p>\n<p><span>&#160;&#160; <\/span>TypeName: System.Security.Principal.NTAccount         <\/p>\n<p>Name<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>MemberType Definition         <br \/>&#8212;-<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-         <br \/>Equals<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>bool Equals(System.Object o)         <br \/>GetHashCode<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>int GetHashCode()         <br \/>GetType<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>type GetType()         <br \/>IsValidTargetType Method<span>&#160;&#160;&#160;&#160; <\/span>bool IsValidTargetType(type targetType)         <br \/>ToString<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>string ToString()         <br \/>Translate<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Method<span>&#160;&#160;&#160;&#160; <\/span>System.Security.Principal.IdentityReference Tra&#8230;         <br \/>Value<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>Property<span>&#160;&#160; <\/span>System.String Value {get;}<\/font><\/span><span style=\"font-size: 9.5pt\">      <\/p>\n<p><\/span><\/p>\n<\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">The <b>IdentityReference<\/b> property points to a specific user account. You can use that property to return a list of all the users who have access to a folder. When you query the <b>Value<\/b> property, it returns a string. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access | ForEach-Object { $_.identityReference.value }        <br \/>NWTRADERS\\Administrator         <br \/>BUILTIN\\Administrators         <br \/>BUILTIN\\Administrators         <br \/>NT AUTHORITY\\SYSTEM         <br \/>NT AUTHORITY\\SYSTEM         <br \/>BUILTIN\\Users         <br \/>NT AUTHORITY\\Authenticated Users         <br \/>NT AUTHORITY\\Authenticated Users         <br \/>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">If you wanted to search the list of users for a specific user who has rights, you could pipe the results to the <b>Where-Object<\/b>. This is seen here: <\/p>\n<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #f2f2f2\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; $acl.Access | ForEach-Object { $_.identityReference.value |        <br \/>Where-Object { $_ -eq &#8216;nwtraders\\administrator&#8217; }<span>&#160; <\/span>}         <br \/>NWTRADERS\\Administrator         <br \/>PS C:\\&gt; <\/font><\/span>    <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">Well, BH, this brings us to the end of another Hey, Scripting Guy! post. We hope we have inspired you to fire up Windows PowerShell and start playing around with the <b>Get-Acl<\/b> cmdlet. <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">If you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/www.twitter.com\/scriptingguys\/\" target=\"_blank\">Twitter<\/a> or <a href=\"http:\/\/www.facebook.com\/group.php?gid=5901799452\" target=\"_blank\">Facebook<\/a>. If you have any questions, send e-mail to us at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a> or post them on the <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en\/ITCG\/threads\/\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace. <\/p>\n<\/p>\n<p style=\"margin: 0in 0in 8pt\" class=\"MsoNormal\">\n<p>&#160;<\/p>\n<\/p>\n<p style=\"margin-left: 0in\"><b><span>Ed Wilson and Craig Liebendorfer, Scripting Guys <\/span><\/b>    <\/p>\n<\/p>\n<p style=\"margin-left: 0in\"><b><span><\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Share this post: Hey, Scripting Guy! I am trying to get a handle around the security of a folder on my computer. I need to be able to figure out a way to determine who has access and what those access rights are. I guess I could use the Icacls utility, but I prefer to [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[62,3,63,45],"class_list":["post-52473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-dacls-and-sacls","tag-scripting-guy","tag-security","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Share this post: Hey, Scripting Guy! I am trying to get a handle around the security of a folder on my computer. I need to be able to figure out a way to determine who has access and what those access rights are. I guess I could use the Icacls utility, but I prefer to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=52473"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52473\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=52473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=52473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=52473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}