$value as values in KB and $value/1GB will give reset in GB
$value = 1231232
$value/1GB
$value/1MB
Formula to truncate decimals for a given value
[math]::truncate(110.12112321)
$value as values in KB and $value/1GB will give reset in GB
$value = 1231232
$value/1GB
$value/1MB
Formula to truncate decimals for a given value
[math]::truncate(110.12112321)
Powershell command to export list of user details like name, mailbox size and item count on the specific Exchange server
$Exservername = <Servername>
Get-Exchangeserver | Where {$_.Name -eq $Exservername} | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize.Value.ToMB()},ItemCount
Below Powershell command can be used to export the list of mailboxes properties like DisplayName, totalItems,ItemCount for the list of users given in a text file to a export to a csv file
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,TotalItemSize,ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize.Value.ToMB()},ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize/1.0MB},ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize.Value.ToGB()},ItemCount| Export-Csv c:\MailboxStatistics.csv
This is a Beautiful piece of code which helps in moving the Multiple mailboxes in Multithread.
Sourcefilepath contact the text file with the list of alias names or email address of the users to move.
TargetDatabase should have the path of the destination store where mailstore to be moved.
Maxthreads 8 will move 8 users at a time, you can increase this count based on the performace of your machine.
-BadItemsLimit is if mailbox which is moved has some corrupted item then move-mailbox wil skip the corruption upto 30 items. If this corsses then specific mailbox will not be moved, but it will continue to move rest of the mailbox.
$TargetDatabase = “Path to the destination Store”
$k = Get-Content “SourceFilepath”
$k| Get-Mailbox | Move-Mailbox -BadItemLimit ’30’ -TargetDatabase $TargetDatabase -maxthreads 8 -Confirm: $false