I have compiled a command to dig out Shared folders & there access permissions.
=============================================================================================
ACL :
1.
Get-Acl c:\foldername | Select-Object
Path,Owner,Group,AccessToString | Export-Csv -path C:\ACL.CSV
2.
Dir c:\foldername | Get-Acl | Select-Object
Path,Owner,Group,AccessToString | Export-Csv -path c:\dir.csv
3.
Get-content -path c:\folders.txt | get-acl |
Select-Object Path,Owner,Group,AccessToString | Export-Csv c:\folders.csv
4.
Get-Content Folders.txt | Foreach-Object {
get-acl $_ }
5.
Classical Commands : Cacls & Xcacls
Share Folders :
1.
Get-WmiObject win32_share
2.
Get-WmiObject win32_share -filter
"name='foldername'"
3.
Get-WmiObject win32_share | Select-Object
path,name,description | Export-Csv c:\AllShareFolders.csv
4.
$Share = gwmi -class Win32_Share | sort type,
name
$Share | ft name, description, type, path -auto
$Share | ft name, description, type, path -auto
Combined :
Get-WmiObject win32_share -filter "name='test'" |
get-acl | Select-Object Path,Owner,AccessToString | fl
Whole & Soul:
Get-WmiObject win32_share | Get-Acl | Select-Object
Path,Owner,AccessToString | Export-Csv -path c:\permissions.csv
===============================================================================================
No comments:
Post a Comment