o365 where-object

Welcome Forums General PowerShell Q&A o365 where-object

This topic contains 2 replies, has 2 voices, and was last updated by

1 year, 8 months ago.

  • Author
  • #68214

    Points: 0
    Rank: Member


    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

    Points: 0
    Rank: Member

    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

      Points: 262
      Helping Hand
      Rank: Contributor

      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.

The topic ‘o365 where-object’ is closed to new replies.