Finding all Exchange 2010 mailboxes that are not healthy and updating them

In an Exchange 2010 environment, for one reason or another some or many of your mailboxes may be left in an unhealthy state, and need to be reseeded. Rather than having to do each one manually, yo ucan use this PowerShell command:

Get-MailboxDatabaseCopyStatus -Server <servername> | where{$_.status -ne "Healthy"} | Update-MailboxDatabaseCopy -CatalogOnly

Note – this specific command will update the catalog only. If you require a full reseed, change as neccessary.

Exchange 2010 transport log report using CSV

$date = Get-Date
$today = $date.ToShortDateString()
$lastweek = $date.AddDays(-7).ToShortDateString()
$result = Get-MessageTrackingLog -recipients <enter email address here> -start $lastweek -end $today | Select-Object Timestamp,Sender,MessageSubject
$csvresult = $result | Export-Csv c:\scripts\solution_center_emails.csv

# Configuration
$emailFrom = "<enter from address here>"
$emailTo = @("","")
$emailSubject = "<enter subject here>"
$emailBody = "See the attached file in CSV format for the calls from $lastweek to $today"
$emailAttachment = "c:\scripts\solution_center_emails.csv"
$smtpServer = "<enter SMTP server here>"

# Send E-Mail
Send-MailMessage -To $emailTo -From $emailFrom -Subject $emailSubject -Body $emailBody -Attachment $emailAttachment -SmtpServer $smtpServer

#Clean up / Remove File
if (Test-Path $emailAttachment) {Remove-Item $emailAttachment}

Exchange 2010 transport log report using HTML

$a = "<style>"
$a = $a + "BODY{background-color:white;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:white}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:white}"
$a = $a + "</style>"

$date = Get-Date
$today = $date.ToShortDateString()
$yesterday = $date.AddDays(-1).ToShortDateString()

$result = Get-MessageTrackingLog -recipients <enter email address here> -start $yesterday -end $today | Select-Object MessageSubject,Sender,Timestamp
$htmlresult = $result | ConvertTo-HTML -head $a -body "<H4>Emails addressesd to <enter email address here> from $yesterday to $today</H4>"

# Configuration
$emailFrom = "<enter from address here>"
$emailTo = "<enter to address here>"
$emailSubject = "<enter Subject here>"
$emailMessage = $htmlresult
$smtpServer = "<enter SMTP server here>"

# SMTP Object
$smtp = New-Object System.Net.Mail.SmtpClient($smtpServer)

# Send E-Mail
$msg = New-Object System.Net.Mail.MailMessage $emailFrom, $emailTo, $emailSubject, $emailMessage
$msg.isBodyhtml = $true

Adding receive connector IP addresses using PowerShell

Be sure to modify your values for the connector name, and file path. This will append to the existing path, not over write it. It will throw an error and continue if a value already exists.

$rc = Get-ReceiveConnector -Identity “Anonymous SMTP Relay Connector”
Get-Content "c:\scripts\addrelayips.txt" | foreach {$rc.RemoteIPRanges += "$_"}
Set-ReceiveConnector "Anonymous SMTP Relay Connector" -RemoteIPRanges $rc.RemoteIPRanges

“No description found” message when editing a maintenance plan in SQL 2005

Here is the fix:

Before you open the management studio, run this to re register the proper DLL’s.

Regsvr32 "C:\WINDOWS\system32\msxml6.dll"
Regsvr32 "C:\WINDOWS\system32\msxml3.dll"
Regsvr32 "C:\WINDOWS\system32\msxml.dll"
regsvr32.exe ole32.dll

Then open the management studio and you will be able to save the changes to your maintenance plan.

The name on the security certificate is invalid or does not match the name of the site

When starting Outlook, I was getting a cert error that said this. What I did to fix it:

1. Removed all the certs that it would let me from the Exchange server. I had to leave the default there so that I did not break SMTP.

2. Created a new cert with the following in there for the SANs

Don’t forget the last SAN of internaldomain.local alone.  Imported this certtificate, and enabled it for IIS and SMTP, replacing the old certificate. I then deleted the old one, and all was well again.