Alans Wiki

IT tips and tricks

Folder Permissions Groups

Posted by alambert on October 6, 2022
Posted in: Active Directory, Powershell. Tagged: ad, powershell.

 $AllFolders = Get-ChildItem -Directory -Path "\\server\Share$\" -Force -depth 3
$Results = @()
Foreach ($Folder in $AllFolders) {
$Acl = Get-Acl -Path $Folder.FullName
foreach ($Access in $acl.Access) {
if ($Access.IdentityReference -notlike "BUILTIN\Administrators" -and $Access.IdentityReference -notlike "domain\Domain Admins" -and $Access.IdentityReference -notlike "CREATOR OWNER" -and $access.IdentityReference -notlike "NT AUTHORITY\SYSTEM") {
$Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD Group'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
$Results += New-Object -TypeName PSObject -Property $Properties
}
}
}
$Results | Export-Csv -path "C:\temp\FileName - $(Get-Date -format MMyy) b.csv" 

Posts navigation

← How to reset ESXi evaluation license
MSGraph Powershell module →
  • Recent Posts

    • Change the RDS “Work Resources”
    • Create SG for folders
    • Enable inheritance on all AD user
    • MSGraph Powershell module
    • Folder Permissions Groups
  • Categories

    • Active Directory
    • phentermine effectiveness
    • http://www.thelamberts.com/wiki/adipex-buy/
    • xanax pictures
    • http://www.thelamberts.com/wiki/tramadol-depression-side-effect/
    • Command Line
    • Data Center
    • DHCP
    • DNS
    • DNS
    • Exchange
    • Hyperv
    • Networking
    • Offfice 365
    • OneNote
    • Patching
    • PowerCLI
    • Powershell
    • RemoteApps
    • Shortcuts
    • Single
    • Splunk
    • Uncategorized
    • Veeam
    • VMware
    • Windows
    • Workstation
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.