o365 where-object

This topic contains 2 replies, has 2 voices, and was last updated by  Olaf Soyk 7 months, 2 weeks ago.

  • Author
  • #68214



    I am trying to create a where-object on the prohibitsendquota within o365. New accounts that have been created dont get a quota so i am trying to find all the mailboxes that dont equal the default mailbox size of 49.5 GB. Here is what I have but it returns no results
    get-mailbox -resultsize unlimited | where-object {$_.prohibitsendquota -contains "49.5"} | selecect displayname,prohibitsendquota

    The default result if i just get-mailbox for a user is ProhibitSendQuota: 49.5 GB (53,150,220,288 bytes)

    Any help would be appreciated!

  • #68215


    Nevermind I figured it out. Where-object does not support the -contains so i used -like "*49.5*"

    get-mailbox -resultsize unlimited | where-object {$_.prohibitsendquota -like "*49.5*"} | select displayname

    • #68217

      Olaf Soyk

      Where-object does not support the -contains

      Just to make this clear and avoid missunderstandings – Where-Object does supoort -contains. It just works different than you probably think of.

You must be logged in to reply to this topic.