Category Archives: Exchange

Exchange 2010 tested commands

Stuck mail in Outbox – Powershall Exchange 2010

Check all mailboxes with “stuck” e-mails in Outbox: Get-Mailbox -OrganizationalUnit ‘domain.com/exchange resources’ | Get-MailboxFolderStatistics -FolderScope Outbox | ft identity,name,itemsinfolder -AutoSize Script for getting all mailboxes with items more than 0 in Outbox: Get-Mailbox -resultsize unlimited| Get-MailboxFolderStatistics -FolderScope Outbox | where … Continue reading

Posted in Exchange | Leave a comment

There is a problem with the proxy server’s security certificate. The name on the security certificate is invalid or does not match the name of the target site outlook.office365.com. Outlook is unable to connect to the proxy server (Error Code 0)

There are many possible causes for the Outlook Error 0 message. I’ve spent some time trying to figure out what’s causing this and also most of the solutions found on Internet didn’t help as they were suggesting server-side operations. As … Continue reading

Posted in Exchange, Windows | 4 Comments

Exchange – view the size of all Deleted Items folders

Get-Mailbox -ResultSize unlimited | Get-MailboxFolderStatistics | where{$_.FolderType -eq “DeletedItems”} | Select-Object Identity, {$_.FolderAndSubFolderSize.ToMb()}, ItemsInFolderAndSubFolders | sort Identity By default, the Sort-Object cmdlet performs an ascending sort  ( sort -desc for descending sort )  

Posted in Exchange | Leave a comment

Exchange – A few archiving commands

1. Which mailbox users have the personal archive enabled; Get-Mailbox | where {$_.ArchiveDatabase -ne $null} 2. List all archive enabled users along with their archive mailbox settings; Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | ft name, archivedatabase, archivename, archivequota, archivewarningquota … Continue reading

Posted in Exchange | Leave a comment

Exchange DB whitespace & LastFullBackup

Get-MailboxDatabase -Status | Select-Object Server,Name,AvailableNewMailboxSpace Get-MailboxDatabase -Status | Sort -Property LastFullBackup |ft Identity,LastFullBackup

Posted in Exchange | Leave a comment

Exchange Remove Disconnected Mailbox

View disconnected/removed mailboxes from Database 001: Get-MailboxStatistics -Database “Mailbox Database 001” | Where-Object {$_.DisconnectDate -Notlike $NULL} | FL DisplayName, DisconnectDate, MailboxGuid Result: DisplayName    : Alice Cooper DisconnectDate : 28/10/2013 09:15:15 MailboxGuid    : 65d7b0a1-3a1c-49e6-b349-ec66c859d56c Can also use Get-MailboxStatistics -Server servername Delete … Continue reading

Posted in Exchange | Leave a comment

Exchange remove member from all e-mail groups using shell

Remove-DistributionGroupMember  -member jon.doe -confirm:$false -Identity “Staff” Staff = group name Add-DistributionGroupMember for adding members to a group To remove jon.doe from all groups: $GG = Get-DistributionGroup $RG = $GG  | where { (Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains “jon.doe@domain.com”} foreach( … Continue reading

Posted in Exchange | Tagged | 1 Comment

Exchange enable mailbox audit

set-Mailbox my.mailbox -AuditEnabled $true Get-Mailbox my.mailbox | fl *audit*   (view  if auditing is enabled) Get-LogonStatistics -Identity my.mailbox |fl ClientIpAddress  (obvious)

Posted in Exchange | Tagged | Leave a comment

Exchange – add address to Outlook’s safe senders list

get-DistributionGroupMember -identity “Staff” | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add=’john@domain.com’, ‘@domain2.com’} (for a group) get-Mailbox | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add=’john@domain.com’, ‘@domain2.com’} (for all) get-MailboxJunkEmailConfiguration -identity “ALIAS” (check)

Posted in Exchange | Tagged , | Leave a comment

Exchange save/export mailbox to pst file

New-MailboxExportRequest -Mailbox “alice.cooper” -IncludeFolders “#Contacts#” -FilePath  \\server_name\temp\alice_cooper.pst -ExcludeDumpster   (exports only Contacts folder ) New-MailboxExportRequest -Mailbox alice.cooper -FilePath  \\server_name\temp\alice_c.pst  (export user’s mailbox) Get-MailboxExportRequestStatistics -Identity: alice.cooper\MailboxExport  – to see the export status # Export all e-mails between date range ( Including Sent … Continue reading

Posted in Exchange | Leave a comment