param([string]$Output = "share_report.html") " " > $Output "

GROUP MEMBERS

" >> $Output $groups = Get-ADGroup -Filter * -Properties * foreach($g in $groups) { if($g.members) { "" >> $Output } } "
$($g.name)
" >> $Output foreach ($member in $g.members) { "$member
" >> $Output } "

SHARE PERMISSIONS

" >> $Output $shares = Get-WmiObject win32_LogicalShareSecuritySetting | select -ExpandProperty name foreach($share in $shares) { "" >> $Output $descr = Get-WmiObject win32_LogicalShareSecuritySetting | Where { $_.name -eq $share } $acls = $descr.GetSecurityDescriptor().Descriptor.DACL foreach($acl in $acls) { "" >> $Output } "
$share
$($acl.Trustee.Domain)\$($acl.Trustee.Name)$($acl.AccessMask -Replace 2032127,"Full Control" -Replace 1245631,"Change" -Replace 1179817,"Read")
" >> $Output } "" >> $Output Write-Host "Report saved to: $Output"