phillips321 / adaudit

Powershell script to do domain auditing automation
https://www.phillips321.co.uk
374 stars 100 forks source link

Administrators Group #30

Open ltwarner opened 2 years ago

ltwarner commented 2 years ago

Useful to list the "Administrators" group for the domain as well These lines have been added throughout the script, although not fully tested yet

$script:Administrators                 = New-Object System.Security.Principal.SecurityIdentifier "S-1-5-32-544"
Write-Both "    [+] Administrators               : $Administrators"

if(($Administrators | measure).count -ne 0){
        Write-Both "    [!] Administrators!!!"
    foreach($member in $Administrators){
        Add-Content -Path "$outputdir\administrators.txt" -Value "$($member.objectClass) $($member.SamAccountName) $($member.Name)"
    }
}