TechShizz | All posts tagged 'Exchange Online'

How to purge deleted items from recoverable items in Exchange

If you want to delete all the deleted items in a mailbox that are still recoverable you can use this command:

Search-Mailbox -Identity "David Cooper" -SearchDumpsterOnly -TargetMailbox "Discovery Search Mailbox" -TargetFolder "david.cooper-RecoverableItems" -DeleteContent

If you do not wish to make a copy of the deleted items first to the Discovery Mailbox, and just delete them, use this command:

Search-Mailbox -Identity "David Cooper" -SearchDumpsterOnly -DeleteContent

Read Receipts showing wrong time or time zone for Office 365 mailbox

If you get read receipts that state the time it was read was the previous day, or the time is just wrong this could be to do with the time settings on the mailbox.

Microsoft have a poor guide on this explaining WHY it happens, but does not say how to resolve it. 

https://support.microsoft.com/en-gb/help/2800633/read-receipt-from-an-office-365-recipient-displays-incorrect-time-zone-information

Here is the solution:

We can check this by first connecting to Office 365 via Azure PowerShell, and then running the follwing command. 

Get-MailboxRegionalConfiguration -Identity rtownsend@domain.co.uk | fl

If the TimeZone is wrong, it will be obvious. You will need to change it to your users local time zone. To see a list of time zones run this command in PowerShell.

$TimeZone = Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | foreach {Get-ItemProperty $_.PSPath}; $TimeZone | sort Display | Format-Table -Auto PSChildname,Display

Once you know your time zone, run the following (replacing your correct time zone). 

Set-MailboxRegionalConfiguration -Identity rtownsend@domain.co.uk -TimeZone "GMT Standard Time"

https://technet.microsoft.com/en-us/library/dd351103(v=exchg.160).aspx

 

Reporting Mailbox Folder Sizes with PowerShell

PowerShell script to find the size of each folder in a mailbox and also how many items there are in each folder.

Get-MailboxFolderStatistics Username -FolderScope Inbox | Select Name,FolderandSubFolderSize,ItemsinFolderandSubfolders

List all SMTP addresses with PowerShell

Open PowerShell > 


Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}