Author Posts

April 7, 2017 at 4:17 am

Hello!

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!

April 7, 2017 at 4:35 am

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

April 7, 2017 at 6:02 am

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.