2
0

Change the way AD read Enabled accounts

This commit is contained in:
2026-06-15 07:46:45 +00:00
parent c59138fdda
commit 2c8f9d87c2
@@ -64,7 +64,7 @@
#region script #region script
#Collect all users and the attributes we need #Collect all users and the attributes we need
foreach ($SearchBase in $STR_OUSearchBase) { 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 #Start foreach statement of above query
foreach ($User in $QRY_ADUsers) { foreach ($User in $QRY_ADUsers) {