Share via


Can't get get-adcomputer to filter on Description...

Question

Monday, September 18, 2017 8:51 PM

Howdy,

I'm trying to pull a list of computer that have a blank/null description.  I tried using get-adcomputer -filter {description -eq $null} but I get an error that $null is not defined.

If I do something like get-adcomputer -filter {Description -like "text*"} I get results just fine.

Can I not use $null in a filter statement or is there some syntax I have wrong?

Thanks.

All replies (2)

Monday, September 18, 2017 8:58 PM ✅Answered | 1 vote

get-adcomputer -filter "description -notlike '*'"

\(ツ)_/


Monday, September 18, 2017 9:03 PM

get-adcomputer -filter "description -notlike '*'"

\(ツ)_/

Ah ha.  I had actually thought about that at one point but I guess I never tried it.  I wasn't sure if an * would include nothing or if it had to be something.  I'll give that a whirl.

Thanks.