Logging SMTP Protocol Activity in Exchange 2007 / 2010

Enable protocol logging on a Receive Connector

Set-ReceiveConnector “Connector Name” -ProtocolLoggingLevel verbose

Receive Connector logs default path:

  • Exchange 2010: \Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive
  • Exchange 2007: \Exchange Server\TransportRoles\Logs\ProtocolLog\SmtpReceive

To change:

Set-TransportServer “TRANSPORT SERVER NAME” -ReceiveProtocolLogPath “C:\Directory”

Enable protocol logging on a Send Connector

Set-SendConnector “Send Connector Name” -ProtocolLoggingLevel verbose

Send Connector logs default path:

  • Exchange 2010: \Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpSend
  • Exchange 2007: \Exchange Server\TransportRoles\Logs\ProtocolLog\SmtpSend

To change:

 Set-TransportServer “TRANSPORT SERVER NAME” -SendProtocolLogPath “C:\Directory”

Exchange 2010: Unable to open Exchange Management Console – Initialization Failed

Message:
The attempt to connect to http://exchange.contoso.com’/powershell using ‘Kerberosauthentication failed: Connecting to the remote server failed with the following error message : WinRM cannot process the request…

#1
Close EMC. Open regedit and delete ‘NodeStructureSetting’  from registry: HKEY_CURRENT_USER\SOFTWARE\Microsoft\ExchangeServer\v14\AdminTools.

#2
Make sure that the Kerbauth module (C:\Program Files\Microsoft\Exchange Server\v14\Bin\kerbauth.dll) is not enabled on the default website but is, instead, enabled only for the PowerShell virtual directory.
AND
Make sure that the WSMan module (C:\Windows\system32\wsmsvc.dll) is registered but not enabled at the Server level.

Exchange 2010: Search-Mailbox command not recognized

This problem happens because your account is not a member of the “Discovery Management” role. Since your account does not have permission to perform searches, Powershell does not import the Search-Mailbox cmdlet.

Powershell cmdlet Import-csv, special characters get lost…

An idea how to handle special characters from Powershell:

cat list.csv > list_temp.csv # make utf8
$header = "FirstName","LastName","EmailAddress","Displayname" $csvinfo = import-csv "list_temp.csv" -del ";"  -head $header
ForEach ($line in $csvinfo) {New-MailContact -Name $line.DisplayName -FirstName $line.FirstName -LastName $line.LastName -ExternalEmailAddress $line.EmailAddress -DisplayName $line.DisplayName}
del list_temp.csv

Important part: defaults to reading in utf8 encoding, workaround: cat list.csv > list_temp.csv # make utf8 😉

Prerequisites in IIS for installing the SCOM 2012 Web Console

Web Server (IIS) role with the follow server role services:
(http://technet.microsoft.com/en-us/library/hh205990.aspx#BKMK_RBF_WebConsole)

Static Content
Default Document
Directory Browsing
HTTP Errors
HTTP Logging
Request Monitor
Request Filtering
Static Content Compression
Web Server (IIS) Support
IIS 6 Metabase Compatibility
ASP.NET
Windows Authentication

If you already installed .net 4.0 then you will need to run this command to register IIS with .net 4.0

c:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -r

Farm Passphrase reset in SharePoint 2010

Enter at the PowerShell prompt (Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell):

$passphrase = ConvertTo-SecureString -asPlainText -Force
Set-SPPassPhrase -PassPhrase $passphrase -Confirm

(Of course, the password immediately after you close the PowerShell I found … 🙂 )