locked
Can't get get-adcomputer to filter on Description... RRS feed

  • Question

  • 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.

    Monday, September 18, 2017 8:51 PM

Answers

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

    \_(ツ)_/

    • Proposed as answer by Richard MuellerMVP Monday, September 18, 2017 10:49 PM
    • Marked as answer by Kelemvor33 Monday, September 18, 2017 11:30 PM
    Monday, September 18, 2017 8:58 PM

All replies

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

    \_(ツ)_/

    • Proposed as answer by Richard MuellerMVP Monday, September 18, 2017 10:49 PM
    • Marked as answer by Kelemvor33 Monday, September 18, 2017 11:30 PM
    Monday, September 18, 2017 8:58 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.

    Monday, September 18, 2017 9:03 PM