@ Techrid.com
Count of User Mailbox in Organization
Number Mailbox in each Database
Mailbox Size & Statistics
Command : (Get-Mailbox).Count
If your Organization have 1000+ employees use the command same with Result size as Unlimited.
Command : (Get-Mailbox -resultsize unlimited).Count
want gathering Individual User Mailbox with Total Item Count, Storage Limit status and users Last logon. Then below is the command
Command :
[PS] C:\>Get-MailboxStatistics -Identity “User Mailbox Name”
Now List of User Mailboxes hosted in the Database with Display name and TotalItemSize with Storagelimitstatus
Command :
[PS] C:\>Get-MailboxDatabase “Database Name” | Get-MailboxStatistics | sort totalitemsize -desc | ft displayname, totalitemsize, itemcount, storagelimitstatus
In this if you want to deep dive and want to Identify first 5 or 10 mailbox with huge size of Mailbox below is the command to run
Command :
[PS] C:\>Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -desc | Select-Object -First 5 | ft displayname,@{Expression={$_.TotalItemSize.Value.ToGb()};label=”T
otal Mailbox Size in Gb”}
If you want to check by name the exclude the Get-Mailbox and directly go with Get-Mailboxstatistics and when Prompts for Identity provide user Mailbox name as shown below:
Command :
[PS] C:\>Get-MailboxStatistics | Sort-Object TotalItemSize -desc | Select-Object First 5 | ft displayname,@{Expression={$_.TotalItemSize.Value.ToGb()};label=”Total Mailbox Si
ze in Gb”}
First 5 User with huge mailbox size within the specific Database then below is the command:
Command :
[PS] C:\>Get-MailboxStatistics -Database “Database Name” | Sort-Object TotalItemSize -desc | Select-Object -First 5 | ft displayname,@{Expression={$_.TotalItemSize.Value.ToGb()};
label=”Total Mailbox Size in Gb”}
Now Check the number of Mailbox in each Database
Segregating the number of user hosted on each Database.
Command :
[PS] C:\>Get-Mailbox | Group-Object -Property:Database | Select-Object name,count
Now gathering the details with Server Name, StorageGroupName, Database Name, Size (GB), Size (MB), No. Of Mailbox, below is the command:
Command :
[PS] C:\>Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name=”Size (GB)”;Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = “`\`\” + $objitem.se
rver + “`\” + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + “$”+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1048576KB; [math]::r
ound($size, 2)}}, @{Name=”Size (MB)”;Expression={$objitem = (GetMailboxDatabase $_.Identity); $path = “`\`\” + $objitem.server + “`\” + $objItem.EdbFilePath.DriveName.Remove(
1).ToString() + “$”+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((GetChildItem $path).length)/1024KB; [math]::round($size, 2)}}, @{Name=”No. Of Mbx”;expression={(Get
Mailbox -Database $_.Identity | Measure-Object).Count}}
If you want to export below is the command :
Command :
[PS] C:\>Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name=”Size (GB)”;Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = “`\`\” + $objitem.se
rver + “`\” + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + “$”+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1048576KB; [math]::r
ound($size, 2)}}, @{Name=”Size (MB)”;Expression={$objitem = (GetMailboxDatabase $_.Identity); $path = “`\`\” + $objitem.server + “`\” + $objItem.EdbFilePath.DriveName.Remove(
1).ToString() + “$”+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((GetChildItem $path).length)/1024KB; [math]::round($size, 2)}}, @{Name=”No. Of Mbx”;expression={(Get
Mailbox -Database $_.Identity | Measure-Object).Count}} | Export-CSV C:\ServerStat-2.csv
[PS] C:\>
Now want to check the list of users hosted in the Database then below is the command
Command :
[PS] C:\>Get-MailboxDatabase “DatabaseName” | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount
If you have more than 50+ users and if you want to export below is the command
← Exchange 2010 to 2013 mailbox migration is Very slow
Exchange 2013 CU8 to CU12 Upgrade – Unattended Mode →
Command :
[PS] C:\>Get-MailboxDatabase “FBMBXDB01” | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount >C:\MB.csv
Ok we are done with Mailboxes.
Last but not least Database Size and free space
Gathering Database Size with New Available New Mailbox Space
Command :
[PS] C:\>Get-MailboxDatabase -Status | select Name,DatabaseSize,AvailableNewMailboxSpace
Checking Database Size
Command :
[PS] C:\>Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize
No comments:
Post a Comment