Search code examples
powershellexchange-server-2007

Calculate and apply a new ProhibitSendQuota with Powershell


With this command :

get-mailbox -identity JSMITH | select ProhibitSendQuota

i get the ProhibitSendQuota for my mailbox JSMITH

I want to add 50 MB to the ProbitiSendQuota with just one powershell command line

I have to use this command

set-mailbox -identity JSMITH -ProhibitSendQuota MyNewQuota

So what is the command to get the actual ProhibitSendQuota and had it 50 Mb ? I think it's something like this but I don't know the exact syntax

get-mailbox -identity JSMITH | set-mailbox -identity $_.name -ProbibitSendQuota {($_.ProbititSendQuota) * 50 * 1024}

Someone have a solution ?

Thx


Solution

  • Get-Mailbox -Identity jsmith | foreach{ $_ | Set-Mailbox -ProhibitSendQuota ($_.ProhibitSendQuota+50mb)}