← script library

Report SMB Shares and Permissions with PowerShell

Windows Server RolesAugust 17, 2026

Lists every share with its path and share-level access entries, and flags any share where Everyone has more than read access — matching the German account name as well, which is where this kind of check usually fails. Administrative shares are hidden unless you ask for them.

powershell
# SMB Share Report
# Single use case: list all shares with their permissions (audit view)
#-----------------------------------------------------------------

function Write-Log {
    param($Message)
    Write-Host "<WRITE-LOG = `"*$Message*`">"
}

# --- Parameters (replace via ServerEngine API parameters if needed) ---
$IncludeHidden = $false   # $true also lists admin shares (C$, ADMIN$, IPC$)

$shares = Get-SmbShare -ErrorAction SilentlyContinue
if (-not $IncludeHidden) {
    $shares = $shares | Where-Object { -not $_.Special }
}
if (-not $shares) { Write-Log "No shares found (hidden shares excluded)."; return }

Write-Log "================ SMB Shares ($(@($shares).Count)) ================"
foreach ($s in $shares) {
    Write-Log "[$($s.Name)] path: $($s.Path)"
    $access = Get-SmbShareAccess -Name $s.Name -ErrorAction SilentlyContinue
    foreach ($a in $access) {
        Write-Log "    $($a.AccessControlType): $($a.AccountName) -> $($a.AccessRight)"
    }
    $everyone = $access | Where-Object { $_.AccountName -match "Everyone|Jeder" -and $_.AccessControlType -eq "Allow" -and $_.AccessRight -ne "Read" }
    if ($everyone) {
        Write-Log "    WARNING: 'Everyone' has $($everyone.AccessRight) on this share!"
    }
}

Write-Log "Share report complete."

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.