Windows 2008 file/folder permissions not alphabetical?

Soldato
Joined
7 May 2004
Posts
5,503
Location
Naked and afraid
Windows 2008 file/folder permissions not alphabetical, why on earth is that?

Does anyone know how to make them sort alphabetically?

I'm trying to audit some work and it's proving rather difficult when I have to scroll up and down constantly to confirm each perm!
 
powershell code from here http://poshcode.org/1721 will dump it to and excel doc so you can sort/filter etc for easier reading

the code below has a minor tweak to make sorting easier

Code:
$Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()

$wSheet = $Excel.Worksheets.Item(1)
$wSheet.Cells.item(1,1) = "Folder Path:" 
$wSheet.Cells.Item(1,2) = "Users/Groups:"
$wSheet.Cells.Item(1,3) = "Permissions:"
$wSheet.Cells.Item(1,4) = "Permissions Inherited:"

$WorkBook = $wSheet.UsedRange
$WorkBook.Interior.ColorIndex = 8
$WorkBook.Font.ColorIndex = 11
$WorkBook.Font.Bold = $True

####Change the path to the folder or share you want NTFS perms on####
$dirToAudit = Get-ChildItem -Path "c:\temp" -recurse | Where {$_.psIsContainer -eq $true}

$intRow = 1
foreach ($dir in $dirToAudit)
{
	$colACL = Get-Acl -Path $dir.FullName

	foreach ($acl in $colACL)
		{
			#$intRow++
			#$wSheet.Cells.Item($intRow,1) = $dir.FullName
			
				foreach ($accessRight in $acl.Access)
					{
						$wSheet.Cells.Item($intRow,1) = $dir.FullName
						$wSheet.Cells.Item($intRow,2) = "$($AccessRight.IdentityReference)"
				    	$wSheet.Cells.Item($intRow,3) = "$($AccessRight.FileSystemRights)"
						$wSheet.Cells.Item($intRow,4) = $acl.AreAccessRulesProtected
						$intRow++
					}
		}
	
}
$WorkBook.EntireColumn.AutoFit()
 
Back
Top Bottom