cannot filter for empty company attribute

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 5 years, 7 months ago.

  • Author
    Posts
  • #6239

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

You must be logged in to reply to this topic.