diff --git a/Active Directory/Account-expiration-send_mail.ps1 b/Active Directory/Account-expiration-send_mail.ps1 index 5feffc9..4b5dcbd 100644 --- a/Active Directory/Account-expiration-send_mail.ps1 +++ b/Active Directory/Account-expiration-send_mail.ps1 @@ -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) {