I'm using Get-ADUser to retrieve all of the users in the DC except those in three specific groups previously defined using their distinguished name. The below returns 14 users when it should return 5.
$users = Get-ADUser -Filter { ((memberof -notlike $grp1) -and (memberof -notlike $grp2) -and
(memberof -notlike $grp3))} | MyFunction | Where-Object {$_.Enabled -ne $false}
Any thoughts? Thanks in advance.