Get-mailbox command and convert the sendprobhit qouta to bytes

Hi There,

i am trying to create a script which will give you the current probhitsendquota on users mailbox and convert it into bytes as show in below command then i will use the output of it and add 536870912 bytes to it and set a new send and warning quota.

$CurrentSize = (Get-Mailbox -Identity user1).ProhibitSendQuota.IConvertible.ToByte()

$RaiseSize = $CurrentSize + 536870912
$WarningSize = $CurrentSize + 471859200

But unluckily when i try to set it, it wont give me any results it just sits blank, hence need an assitance where i can get the value converted to

May 4th, 2015 3:19am

I don't know if it's your problem but the method should be "ToBytes".

Free Windows Admin Tool Kit Click here and download it now
May 4th, 2015 2:00pm

It's a string, so you can strip the useless stuff and cast it as double. Try it like this:

[double]((Get-Mailbox -Identity vasil).ProhibitSendQuota).Split(" ")[2].trimstart("(")

May 4th, 2015 4:28pm

Hi,
About EWS script problem, I suggest to post thread on Exchange Development forum for more help.

My personal opinion:

$CurrentSize = {Get-mailbox user1 | Select-Object {$_.ProhibitSendQuota.lConvertible.ToBytes()}}

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
May 5th, 2015 5:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics