Hi to all,
Just in case someone needs simple script to check permissions on remote shares, here it is.
#==========================================================================
# 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 = "SilentlyContinue"
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = "Share"
$c.Cells.Item(1,2) = "Account"
$c.Cells.Item(1,3) = "Permission"
$c.Cells.Item(1,4) = "User Name"
$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()
Regards from Serbia.