Category Archives: Exchange 2007

Exchange Forwarding Report

This powershell snippet will tell you which mailbox is actively forwarding email, in what method (dual delivery or pure forwarding), to which email address and if the corresponding contact still exists and is active.

#Module name: findForwarderDetails
#Author: Jos Lieben (OGD)
#Date: 01-04-2016
#Description: this snippet will discover all active forwarders in your organization, and will print the original mailbox, target contact and target address and forwarding method

$output = @()
$mailboxes = Get-Mailbox -ResultSize Unlimited | Where {$_.ForwardingAddress -ne $Null}

foreach ($mailbox in $mailboxes){

    $obj = New-Object PSObject
    $obj | Add-Member NoteProperty mailboxName($mailbox.DisplayName)
    if($mailbox.DeliverToMailboxAndForward){
        $obj | Add-Member NoteProperty forwardingMode("Dual delivery")
    }else{
        $obj | Add-Member NoteProperty forwardingMode("Forward Only")
    }
    try{
        $contact = Get-MailContact -Identity $mailbox.ForwardingAddress.DistinguishedName -ErrorAction Stop
        $obj | Add-Member NoteProperty forwardingToName($contact.DisplayName)
        $obj | Add-Member NoteProperty forwardingToEmail($contact.ExternalEmailAddress)
    }catch{
        $obj | Add-Member NoteProperty forwardingToName("CONTACT DOES NOT EXIST OR IS DISABLED")
        $obj | Add-Member NoteProperty forwardingToEmail("CONTACT DOES NOT EXIST OR IS DISABLED")
    }
    $output += $obj
}

Write-Output $output

Exchange 2007 Hybrid Migration to Office 365 with Exchange 2013 Coexistence

During a migration for a customer from an Exchange 2007 environment, to Office 365, I ran into some issues that I’d like to share, as I could not find any material on this subject elsewhere.

Our plan was easy, update the Exchange 2007 servers to the latest Servicepack and CU to allow coexistence with an Exchange 2013 server as detailed on technet. I’d then build up the Hybrid relationship on the 2013 machine, move the mailboxes and phase out the 2007 machines. The 2013 machine would remain for on-premises Lync connectivity, which needs a CAS to talk to.

Once the Exchange 2013 server was installed, I prepared the machine for Hybrid connectivity, added the relevant domains to Office 365 and started the Hybrid setup wizard from the Exchange 2013 ECP.

I received the following error:

[PS] C:\Windows\system32>Get-WebServicesVirtualDirectory
An IIS directory entry couldn't be created. The error message is Access is denied.
. HResult = -2147024891
    + CategoryInfo          : NotInstalled: (EXCH2007-1\EWS (Default Web Site):ADObjectId) [Get-WebServicesVirtualDirect
   ory], IISGeneralCOMException
    + FullyQualifiedErrorId : [Server=EXCH2013,RequestId=f962a8dd-2d39-4b36-85c3-a16a15fc3252,TimeStamp=9-6-201
   5 07:50:59] [FailureCategory=Cmdlet-IISGeneralCOMException] 18EA544C,Microsoft.Exchange.Management.SystemConfigura
  tionTasks.GetWebServicesVirtualDirectory
    + PSComputerName        : exch2013.fqdn

An IIS directory entry couldn't be created. The error message is Access is denied.
. HResult = -2147024891
    + CategoryInfo          : NotInstalled: (EXCH2007-2\EWS (Default Web Site):ADObjectId) [Get-WebServicesVirtualDirect
   ory], IISGeneralCOMException
    + FullyQualifiedErrorId : [Server=EXCH2013,RequestId=f962a8dd-2d39-4b36-85c3-a16a15fc3252,TimeStamp=9-6-201
   5 07:50:59] [FailureCategory=Cmdlet-IISGeneralCOMException] 18EA544C,Microsoft.Exchange.Management.SystemConfigura
  tionTasks.GetWebServicesVirtualDirectory
    + PSComputerName        : exch2013.fqdn

The hybrid wizard aborted, and could not continue.
The Get-WebServicesVirtualDirectory command checks all Continue reading Exchange 2007 Hybrid Migration to Office 365 with Exchange 2013 Coexistence