<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Reading share security with PowerShell</title>
	<atom:link href="http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/</link>
	<description></description>
	<lastBuildDate>Wed, 21 Dec 2011 09:33:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gord Moore</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-1100</link>
		<dc:creator>Gord Moore</dc:creator>
		<pubDate>Fri, 04 Nov 2011 01:25:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-1100</guid>
		<description>Nice piece of kit - very nice little script that was just what I was after.</description>
		<content:encoded><![CDATA[<p>Nice piece of kit &#8211; very nice little script that was just what I was after.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mladen Milunovic</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-518</link>
		<dc:creator>Mladen Milunovic</dc:creator>
		<pubDate>Thu, 23 Dec 2010 09:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-518</guid>
		<description>Hi, here is a script that list NTFS permissions for remote shares. Only thing is you have to enter shares manualy in to text file. 
[code lans=&quot;ps&quot;]
#==========================================================================
# NAME: ACL on Shared folder
# AUTHOR: Mladen 
# DATE  : 01/12/2010
# COMMENT: Check permissions on NTFS shared folder and send report to excel
# REQUIREMENTS: QuestAD for PowerShell (Quest ActiveRoles), Excel, Acces to share
# shares.txt is file with shares in format \\server\share1
#==========================================================================

#$erroractionpreference = &quot;SilentlyContinue&quot;
$a = New-Object -comobject Excel.Application
$a.visible = $True 
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = &quot;Share&quot;
$c.Cells.Item(1,2) = &quot;Account&quot;
$c.Cells.Item(1,3) = &quot;Permission&quot;
$c.Cells.Item(1,4) = &quot;User Name&quot;
$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$intRow = 2

$colShares = get-content shares.txt
foreach ($strShare in $colShares)
{
$c.Cells.Item($intRow, 1) = $strShare
$c.Cells.Item($intRow, 1).Font.Bold = $True
$acl = Get-Acl $strShare
$perm = $acl.Access
	foreach ($object in $perm)
	{
	$intRow = $intRow + 1
	$userName = [string]$object.IdentityReference
	$c.Cells.Item($intRow, 2) = $userName
	$c.Cells.Item($intRow, 3) = [string]$object.FileSystemRights
	$fullName = Get-QADUser $userName
	$c.Cells.Item($intRow, 4) = $fullName.Name
	}
$intRow = $intRow + 1
}
$d.EntireColumn.AutoFit()
[/code]
Regards,
Mladen.</description>
		<content:encoded><![CDATA[<p>Hi, here is a script that list NTFS permissions for remote shares. Only thing is you have to enter shares manualy in to text file. </p>
<pre class="brush: plain; title: ; notranslate">
#==========================================================================
# NAME: ACL on Shared folder
# AUTHOR: Mladen
# DATE  : 01/12/2010
# COMMENT: Check permissions on NTFS shared folder and send report to excel
# REQUIREMENTS: QuestAD for PowerShell (Quest ActiveRoles), Excel, Acces to share
# shares.txt is file with shares in format \\server\share1
#==========================================================================

#$erroractionpreference = &quot;SilentlyContinue&quot;
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = &quot;Share&quot;
$c.Cells.Item(1,2) = &quot;Account&quot;
$c.Cells.Item(1,3) = &quot;Permission&quot;
$c.Cells.Item(1,4) = &quot;User Name&quot;
$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$intRow = 2

$colShares = get-content shares.txt
foreach ($strShare in $colShares)
{
$c.Cells.Item($intRow, 1) = $strShare
$c.Cells.Item($intRow, 1).Font.Bold = $True
$acl = Get-Acl $strShare
$perm = $acl.Access
	foreach ($object in $perm)
	{
	$intRow = $intRow + 1
	$userName = [string]$object.IdentityReference
	$c.Cells.Item($intRow, 2) = $userName
	$c.Cells.Item($intRow, 3) = [string]$object.FileSystemRights
	$fullName = Get-QADUser $userName
	$c.Cells.Item($intRow, 4) = $fullName.Name
	}
$intRow = $intRow + 1
}
$d.EntireColumn.AutoFit()
</pre>
<p>Regards,<br />
Mladen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin McAlister</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-279</link>
		<dc:creator>Justin McAlister</dc:creator>
		<pubDate>Mon, 26 Apr 2010 19:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-279</guid>
		<description>Got it!  Thank you very much.</description>
		<content:encoded><![CDATA[<p>Got it!  Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-278</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 26 Apr 2010 19:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-278</guid>
		<description>My function cheats a little, passing the values from the ACE into the constructor for Security.AccessControl.FileSystemAccessRule. You&#039;re spot on with the access mask value behaviour. To finish it off you need to read the AceType, that&#039;ll tell you if it&#039;s Allow or Deny.

Chris</description>
		<content:encoded><![CDATA[<p>My function cheats a little, passing the values from the ACE into the constructor for Security.AccessControl.FileSystemAccessRule. You&#8217;re spot on with the access mask value behaviour. To finish it off you need to read the AceType, that&#8217;ll tell you if it&#8217;s Allow or Deny.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin McAlister</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-277</link>
		<dc:creator>Justin McAlister</dc:creator>
		<pubDate>Mon, 26 Apr 2010 19:13:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-277</guid>
		<description>Hi Chris,

I have been trying to do something similar, and was wondering if you came up with the same results.  So with share level permissions there are really only 3 levels of access granting Read, Change, and Full Control.  So I put this together and it reports against those 3 without any issues:
[code lang=&quot;ps&quot;]
(GWMI Win32_LogicalShareSecuritySetting -Computer SERVERNAME).GetSecurityDescriptor().Descriptor.DACL &#124; Select `
	@{N=&quot;Account Name&quot;;E={
		If($_.Trustee.Domain -eq $null){$_.Trustee.Name}
		Else{$_.Trustee.Domain + &quot;\&quot; + $_.Trustee.Name}
	}}, `
	@{N=&quot;Share Permissions&quot;;E={
		Switch($_.AccessMask){
			2032127 {$strSharePerm = &quot;Full Control&quot;} 
			1179817 {$strSharePerm = &quot;Read&quot;}
			1245631 {$strSharePerm = &quot;Change&quot;} 
			Default {$strSharePerm = &quot;Unknown&quot;} 
		}
		$strSharePerm
	}}
[/code]
Please excuse the ugly formatting, and I am sure there is a far better way to do it, but my issue is with implicitly denied share permissions.  The .AccessMask property value for allow full control appears to be the same as deny full control.  Same with read and change.  Now it&#039;s a rare case where I come acrossed deny share permissions, but it&#039;s possible.

I was wondering if you has the same issue with your function.  This is omnipower321 from EE by the way.  You have answered a ton of my questions, and I am a fan of your site.</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>I have been trying to do something similar, and was wondering if you came up with the same results.  So with share level permissions there are really only 3 levels of access granting Read, Change, and Full Control.  So I put this together and it reports against those 3 without any issues:</p>
<pre class="brush: powershell; title: ; notranslate">
(GWMI Win32_LogicalShareSecuritySetting -Computer SERVERNAME).GetSecurityDescriptor().Descriptor.DACL | Select `
	@{N=&quot;Account Name&quot;;E={
		If($_.Trustee.Domain -eq $null){$_.Trustee.Name}
		Else{$_.Trustee.Domain + &quot;\&quot; + $_.Trustee.Name}
	}}, `
	@{N=&quot;Share Permissions&quot;;E={
		Switch($_.AccessMask){
			2032127 {$strSharePerm = &quot;Full Control&quot;}
			1179817 {$strSharePerm = &quot;Read&quot;}
			1245631 {$strSharePerm = &quot;Change&quot;}
			Default {$strSharePerm = &quot;Unknown&quot;}
		}
		$strSharePerm
	}}
</pre>
<p>Please excuse the ugly formatting, and I am sure there is a far better way to do it, but my issue is with implicitly denied share permissions.  The .AccessMask property value for allow full control appears to be the same as deny full control.  Same with read and change.  Now it&#8217;s a rare case where I come acrossed deny share permissions, but it&#8217;s possible.</p>
<p>I was wondering if you has the same issue with your function.  This is omnipower321 from EE by the way.  You have answered a ton of my questions, and I am a fan of your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kleine Tipps f&#252;r Zwischendurch (Teil 13) &#8211; Umgang mit UNC-Pfaden &#171; Peter&#8217;s PowerShell Blog (German only)</title>
		<link>http://www.indented.co.uk/index.php/2009/02/20/reading-share-security-with-powershell/comment-page-1/#comment-40</link>
		<dc:creator>Kleine Tipps f&#252;r Zwischendurch (Teil 13) &#8211; Umgang mit UNC-Pfaden &#171; Peter&#8217;s PowerShell Blog (German only)</dc:creator>
		<pubDate>Fri, 22 May 2009 12:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=972#comment-40</guid>
		<description>[...] Wie sich per WMI und der Win32_LogicalShareSecuritySetting-Klasse die Freigabeberechtigungen auslesen lassen, verrät ein interessanter Blog-Eintrag. [...]</description>
		<content:encoded><![CDATA[<p>[...] Wie sich per WMI und der Win32_LogicalShareSecuritySetting-Klasse die Freigabeberechtigungen auslesen lassen, verrät ein interessanter Blog-Eintrag. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

