Skip to content
SalehRam CLOUD / CODE / LEARNING

Explore the archive

Tag: cmdlet

PS: Read and output mailboxes and their sizes

In order to get a list of all (or part) of the mailboxes and view their sizes, simply use the following PS script: Get-mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName, ItemCount, TotalItemSize, Database -auto | Out-File c:\mbx_sizes.txt The above command, will get all the mailboxes, and list their sizes and the database […]

Read the story : PS: Read and output mailboxes and their sizes

PS: Creating bulk mail contacts

Below is a useful script to create bulk contacts in Exchange Management Shell: Import-CSV “C:\NameList.csv” | Foreach{New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalAddress} You need to have the following prepared before you use the script: A CSV file contains 2 headers: Name, ExternalAddress, with all the contacts list that you want to create. Save the CSV file […]

Read the story : PS: Creating bulk mail contacts