Avatar of sodapop7
sodapop7

asked on 

WIndows PowerShell Scripting

I am trying to get all the security groups attached to specific Shared folders on my Windows 2008 File Server. I have all of the share paths that I want in an excel spreadsheet.I would like to be able to just plug in all the path locations for the folders/shares and incorporate this powershell cmd to get a full listing of all 900 shares.


Get-Acl -Path D:\Data | Format-List accessToString | Out-File -FilePath c:\GroupShareAccess.txt -Append


Does anyone know how I can script this cmd instead of having to use it on each individual path location ?
Crystal ReportsPowershellWindows Server 2008

Avatar of undefined
Last Comment
daveTechSearch
ASKER CERTIFIED SOLUTION
Avatar of daveTechSearch
daveTechSearch
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of KenMcF
KenMcF
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sodapop7
sodapop7

ASKER

Thank a lot. This solved my issue. Both solutions worked for me. I just have one more question. Is there a way to include the path along with the security information that this script spits out ?
you can do something like this for including the path

$shares = get-content c:\get-acl.csv 
$shareACLs = "c:\shareACLs.csv"

@(foreach ($share in $shares)
    {
    $share | 
    select  @{Name='ShareDir';Expression={[string]($share)}},@{Name='accessToString';Expression={get-acl $share | select accessToString}}
    }) |
    export-csv $shareACLs -notype

Open in new window

Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo