Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

PS list accounts

Get Service Accounts

this script finds accounts with patterns

$OUs = 'OU.txt'

Get-Content $Ous | ForEach-Object {
    $OU = $_
    Get-Aduser -Filter * -SearchBase "OU=Service Accounts, ou=$o,ou=enterprise support, dc=ent, dc=ad,.dc=foo,dc=com" | format-table Name >> accounts.txt
}