import-module ActiveDirectory
#get list of accounts to check
$systemAccounts = Get-Content "c:\Scripts\SystemAccounts.txt"
#check if any of these accounts are locked
$lockedAccounts = Search-ADAccount –LockedOut | Where {$systemAccounts -contains $_.Name} | echo Name
#not yet tested this -draft
#get list of accounts to check
$systemAccounts = Get-Content "c:\Scripts\SystemAccounts.txt"
#check if any of these accounts are locked
$lockedAccounts = Search-ADAccount –LockedOut | Where {$systemAccounts -contains $_.Name} | echo Name
#not yet tested this -draft
No comments:
Post a Comment