[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How can I list mailbox sizes rounded to 2 decimal places

Posted on 2012-08-20
5
Medium Priority
?
1,414 Views
Last Modified: 2012-08-20
I am trying to get a list of mailbox sizes rounded to two decimal points. The command below works but it outputs .00 for all mailboxes. For example when I run it against my mailbox the output is 332.00, but my actual mailbox size rounded to two decimal places is 332.89.

Get-MailboxStatistics -Identity MYMAILBOX | ft @{Label = 'Total';expression = { "{0:N2}" -f $_.TotalItemSize.value.Tomb() -replace ","}}

Can someone tell me where I am going wrong with this command. Thank you
0
Comment
Question by:cyberleo2000
5 Comments
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38311709
Why not simply export the data to Csv and view in excel to round of to 2 decimal.

- Rancy
0
 
LVL 8

Accepted Solution

by:
dicconb earned 1000 total points
ID: 38311789
Hi Cyberleo2000,

Try replacing your expression with this:

expression={[math]::round(($_.totalitemsize.tobytes() / 1MB),2)}

Cheers,
D
0
 
LVL 6

Assisted Solution

by:slidingfox
slidingfox earned 1000 total points
ID: 38311949
Exactly what dicconb said, but don't forget value

Get-MailboxStatistics USERNAME | ft @{L='Total';e={[math]::round(($_.totalitemsize.value.tobytes() / 1MB),2)}}

Open in new window

0
 

Author Closing Comment

by:cyberleo2000
ID: 38312079
brilliant, thank you both.
0
 
LVL 8

Expert Comment

by:dicconb
ID: 38312091
Well spotted slidingfox, thanks!

Thanks for the points cyberleo2000,

D
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question