I want this query to only return enabled users who have a name matching "marketing" or "accounting". However, when I run this it's returning disabled users as well? What am I missing? From my research this is what I came up with but it's not working.
Get-ADuser -filter {(Name -like "*marketing*") -or (Name -like "*accounting*") -and (Enabled -eq "true")} -Properties *
Thanks for any advice!