http: WHACKWHACKblogsDOTtechnetDOTcomWHACKbWHACKheyscriptingguyWHACKarchiveWHACK2009WHACK09WHACK14WHACKhey-scripting-guy-september-14-2009DOTaspx
How would I take it a step further and see who are members of "NWTRADERS\Administrator"?
Basically: here is a share, path, folder: share_folder_subfolder
What groups have access to it?
Who are members of those groups?
In an Excel output (not csv).
$TempCSVPath = "D:\Output\SharedAccess.csv" (yes, I know it says csv, but really need Excel)
$RootPath = " share_folder_subfolder"
Write-Output $RootPath | Out-File -FilePath $TempCSVPath -Append
$Acl = Get-Acl -Path $RootPath
$acl.Access | ForEach-Object { $_.identityReference.value } |
Out-File -FilePath $TempCSVPath -Append
*************
logic tells me the next step would be to somehow get "NWTRADERS\Administrators" in $grpname and "Get-ADGroupMember" something like this:
foreach {
$grpname = $_
Get-ADGroupMember -Identity $_ |
select @{N='Group'; E={$grpname}}, Name, SamAccountName
} | Out-File -FilePath $TempCSVPath -Append
************
But I am stuck.
Can you help?
Thanks
MNEsther