who has what access to share and who are the members of groups?
Awesome post at

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

September 8th, 2015 12:56pm

The purpose of this forum is to help answer specific scripting questions, not rewrite code found on the Internet to meet specific specifications.

Please read the following to help you ask a good question:

If you need someone to write or customize code for you, it would be appropriate to pay for that service.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 2:43pm

You ened to learn PowerShell and Excel as well as the Windows file system and Windows access based security.  After you have an understanding of those technologies you will bebetter eYuipped to move forward.

A CSV file is an Excel file.  If you double click it it opens in Excel.

Start by learning what a CSV file is here: https://en.wikipedia.org/wiki/Comma-separated_values

There are many good books on PowerShell and on Windows technologies. 

Start small and learn to do just one thing in your shopping list.  You have posted "guess" code but have not tried to write or run and script. That is where you have to start.

September 8th, 2015 2:53pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics