# cannot filter for empty company attribute

**URL:** <https://forums.powershell.org/t/cannot-filter-for-empty-company-attribute/1294>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/cannot-filter-for-empty-company-attribute/1294 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/cannot-filter-for-empty-company-attribute/1294/1 "2011-12-31T18:30:00Z")

</div>

by fgc at 2012-12-20 14:20:45

> I was trying to get all users with empty company attribute - like this:  
>   
> get-aduser -properties Company -filter {Company -eq $null} or:  
> get-aduser -properties Company -filter {Company -eq "" }  
>   
> but none of these worked. I know that using the "where" statement will work,   
> (get-aduser -filter \* -properties \* | where {$\_.company -eq $null } ) , but I was trying to do it with the -filter expression.  
>   
> Yours  
> FGC

by mikefrobbins at 2012-12-20 16:43:57

> `get-aduser -properties Company -filter {Company -notlike "*"}`

by fgc at 2012-12-20 23:08:09

> Great! - thanks a lot … 🙂

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:03pm UTC](https://forums.powershell.org/t/cannot-filter-for-empty-company-attribute/1294/2 "2024-05-16T21:03:55Z")

</div>


