Change the way AD read Enabled accounts
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
#region script
|
||||
#Collect all users and the attributes we need
|
||||
foreach ($SearchBase in $STR_OUSearchBase) {
|
||||
$QRY_ADUsers = Get-ADUser -SearchBase $SearchBase -Filter {Enabled -eq $true -and PasswordNeverExpires -eq $false } -Properties 'msDS-UserPasswordExpiryTimeComputed', 'mail'
|
||||
$QRY_ADUsers = Get-ADUser -SearchBase $SearchBase -Filter {(Enabled -eq $true) -and (PasswordNeverExpires -eq $false)} -Properties 'msDS-UserPasswordExpiryTimeComputed', 'mail'
|
||||
|
||||
#Start foreach statement of above query
|
||||
foreach ($User in $QRY_ADUsers) {
|
||||
|
||||
Reference in New Issue
Block a user