Archives May 2010

Script to set InternalURL and ExternalURL for all Exchange 2010 Virtual Directories

I’ve been working recently on a series of articles describing how to get Exchange 2010 up and running on a single server.

The aim is to provide small IT shops or those getting started with Exchange 2010 a place to come where they can find out all about the steps needed to get a server operational without having to first wade through the massive help file!

That’s not to say the help file isn’t useful. It is! very very useful. It’s just rather large and intimidating.

In the course of this article, I’ve found that although Exchange 2010 makes more available in the GUI than Exchange 2007 did, there is still not the automation that would make things easy.

For example, when you create a new certificate in the nice new GUI, you enter a whole bunch of information which could then be used to set the relevant URL settings on the multitude of Exchange related virtual directories needed to make things like OWA work properly.

So I started to dig around and found a great script. It started out on the Exchange Ninjas site for Exchange 2007:

http://www.exchangeninjas.com/set-allvdirs

Then another chap got involved and started updating for Exchange 2010:

http://virtualbarrymartin.me/2009/12/29/how-to-setup-exchange-2010-to-use-a-single-certificate-for-internal-and-external-use/

However, he missed a couple of bits, like leaving in the UM virtual directory and not entering the ActiveSync or PowerShell directories. He also didn’t set the OAB to require or not SSL based upon the use of a public certificate.

I’ve fixed those bits and now present the following script which can set all relevant Exchange 2010 virtual directory URLs (both Internal and External) based around a single Exchange 2010 server being connected to the Internet to provide service for a site.

Over time I will probably add more functionality like the ability to set OWA logon type to the email address format (UPN) rather than domain\username.

Hope you find this useful, and more than happy to hear of any improvements that could be made.

Cheers

Nathan

 

# Script to allow you to set all virtual directories to a common name like mail.company.com

Start-Transcript

# Variables

[string]$EASExtend = “/Microsoft-Server-ActiveSync”
[string]$PShExtend = “/powershell”
[string]$OWAExtend = “/OWA”
[string]$OABExtend = “/OAB”
[string]$SCPExtend = “/Autodiscover/Autodiscover.xml”
[string]$EWSExtend = “/EWS/Exchange.asmx”
[string]$ECPExtend = “/ECP”
[string]$ConfirmPrompt = “Set this Value? (Y/N)”
[string]$NoChangeForeground = “white”
[string]$NoChangeBackground = “red”

Write-host “This will allow you to set the virtual directories associated with setting up a single SSL certificate to work with Exchange 2010.”
Write-host “”
[string]$base = Read-host “Base name of virtual directory (e.g. mail.company.com)”
write-host “”

# =============================================
# Validate if a third party trusted certificate is being used
# because BITS used by OAB downloads won’t use untrusted certificates
[string]$set = Read-host “Is the certificate being used an internally generated certificate? (Y/N)”
Write-host “”

if ($set -eq “Y”)    {
    [string]$OABprefix = “http://”
    [boolean]$OABRequireSSL = $false
}    else    {
    [string]$OABprefix = “https://”
    [boolean]$OABRequireSSL = $true
}

# =============================================
# Build the OAB URL and set the internal Value

Write-host “Setting OAB Virtual Directories” -foregroundcolor Yellow
write-host “”

$OABURL = $OABprefix + $base + $OABExtend

[array]$OABCurrent = Get-OABVirtualDirectory

Foreach ($value in $OABcurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $OABUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”)    {
        Set-OABVirtualDirectory -id $value.identity -InternalURL $OABURL -RequireSSL:$OABRequireSSL
    } else {
        write-host “OAB Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $OABUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-OABVirtualDirectory -id $value.identity -ExternalURL $OABURL -RequireSSL:$OABRequireSSL
    } else {
        write-host “OAB Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# ============================================
# Build the Autodiscover URL and set the SCP Value

Write-host “Setting Autodiscover Service Connection Point” -foregroundcolor Yellow
write-host “”

$SCPURL = “https://” + $base + $SCPExtend

[array]$SCPCurrent = Get-ClientAccessServer

Foreach ($value in $SCPCurrent) {
    Write-host “Looking at Server: ” $value.name
    Write-host “Current SCP value: ” $value.AutoDiscoverServiceInternalUri.absoluteuri
    Write-host “New SCP Value:     ” $SCPURL
    [string]$set = Read-host $ConfirmPrompt
    write-host “”
    if ($set -eq “Y”)    {
         Set-ClientAccessServer -id $value.identity -AutoDiscoverServiceInternalUri $SCPURL
    }    else {
        write-host “Autodiscover Service Connection Point internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# =============================================
# Build the EWS URL and set the internal Value

Write-host “Setting Exchange Web Services Virtual Directories” -foregroundcolor Yellow
write-host “”

$EWSURL = “https://” + $base + $EWSExtend

[array]$EWSCurrent = Get-WebServicesVirtualDirectory

Foreach ($value in $EWSCurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $EWSUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”)    {
        Set-WebServicesVirtualDirectory -id $value.identity -InternalURL $EWSURL
     } else {
        write-host “Exchange Web Services Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
     }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $EWSUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”)    {
        Set-WebServicesVirtualDirectory -id $value.identity -ExternalURL $EWSURL
    } else {
        write-host “Exchange Web Services Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# =============================================
# Build the PowerShell URL and set the internal Value

Write-host “Setting UM Virtual Directories” -foregroundcolor Yellow
write-host “”

$PShURL = “http://” + $base + $PShExtend

[array]$PShCurrent = Get-PowerShellVirtualDirectory

foreach ($value in $PShCurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $PShUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-PowerShellVirtualDirectory -id $value.identity -InternalURL $PShURL
    } else {
        write-host “PowerShell Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $PShUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-PowerShellVirtualDirectory -id $value.identity -ExternalURL $PShURL
    } else {
        write-host “PowerShell Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# =============================================
# Build the ECP URL and set the internal Value

Write-host “Setting ECP Virtual Directories” -foregroundcolor Yellow
write-host “”

$ECPURL = “https://” + $base + $ECPExtend

[array]$ECPCurrent = Get-ECPVirtualDirectory

foreach ($value in $ECPCurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $ECPUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-ECPVirtualDirectory -id $value.identity -InternalURL $ECPURL
    } else {
        write-host “ECP Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $ECPUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-ECPVirtualDirectory -id $value.identity -ExternalURL $ECPURL
    } else {
        write-host “ECP Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# =============================================
# Build the OWA URL and set the internal Value

Write-host “Setting OWA Virtual Directories” -foregroundcolor Yellow
write-host “”

$OWAURL = “https://” + $base + $OWAExtend

[array]$OWACurrent = Get-OWAVirtualDirectory

foreach ($value in $OWACurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $OWAUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-OWAVirtualDirectory -id $value.identity -InternalURL $OWAURL
    } else {
        write-host “OWA Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $OWAUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-OWAVirtualDirectory -id $value.identity -ExternalURL $OWAURL
    } else {
        write-host “OWA Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}

# =============================================
# Build the EAS URL and set the internal Value

Write-host “Setting EAS Virtual Directories” -foregroundcolor Yellow
write-host “”

$EASURL = “https://” + $base + $EASExtend

[array]$EASCurrent = Get-ActiveSyncVirtualDirectory

foreach ($value in $EASCurrent) {
    Write-host “Looking at Server: ” $value.server
    Write-host “Current Internal Value: ” $value.internalURL
    Write-host “New Internal Value:     ” $EASUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-ActiveSyncVirtualDirectory -id $value.identity -InternalURL $EASURL
    } else {
        write-host “EAS Virtual Directory internal value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }

    Write-host “Looking at Server: ” $value.server
    Write-host “Current External Value: ” $value.externalURL
    Write-host “New External Value:     ” $EASUrl
    [string]$set = Read-host $ConfirmPrompt
    write-host “”

    if ($set -eq “Y”) {
        Set-ActiveSyncVirtualDirectory -id $value.identity -ExternalURL $EASURL
    } else {
        write-host “EAS Virtual Directory external value NOT changed” -foregroundcolor $NoChangeForeground -backgroundcolor $NoChangeBackground
    }
}
Stop-Transcript


Recovery of data from Exchange 5.5

I had a question recently from a friend at Microsoft about a client who had got into a bit of a pickle!

They needed to restore and email from a mailbox which was 5 years old, long since deleted and on Exchange 5.5.

They did have a backup from the month end, but no idea whether the mail actually was still available or whether it was deleted before month end.

I did a little research and with the help of a couple of other Exchange MVPs Paul Robichaux and Kevin Ball I think I have a solution! We will of course not find out until I get some feedback from my friend.

 

So my thoughts were as follows:

One option to get this back (if it exists) would be to use Ontrack PowerControls. I’ve not done it for a while, but essentially, the idea is you recover the full database from tape and then Ontrack can open it and extract the relevant email. Of course the full tool is not free although there is a free version which might just have enough to do what is needed or at least to help you understand if the email is actually available!

http://www.ontrackpowercontrols.com/resources/trial-downloads/

 

The other option could be interesting! I’m not 100% sure but I believe that if you have Exchange 2003 (possibly later but not sure) you could create a database and then dismount and delete the files. Then put the recovered database (.edb file) in the same location and name it the same as the dummy database file you just deleted. At this point mounting the database should prompt Exchange to upgrade the structure of the DB to Exchange 2003 and allow you to see the mailboxes within. You would then need to create a user account and link the relevant mailbox to that account. (Thanks to Paul for the tip here)

 

So with a bit of luck and possibly some purchasing of tools, assuming the mail wasn’t deleted before the month end back, it should be possible to get it back!

Update:

Having posted something similar on Twitter I received feedback saying the recovery via Exchange 2003 won’t work! So I tested it!! – Yup I actually installed NTT4 and Exchange 5.5.

What I have found so far is that Exchange 2003, will create an STM file but then won’t mount the database. I believe that this is probably due to the fact that they are different organisations as I didn’t carry out a migration to Exchange 2003 instead just installing separate Orgs. I will update later with more progress!

Cheers

Nathan


Hosted Pilot for Microsoft Unified Communications – Features

As promised here is a post looking in a little more depth at the features of the Hosted UC Pilot from Microsoft.

Firstly I will look at some of my favourite features and then will take a look at what is not available.

The first thing that strikes you as you log into Outlook Web App, is that you now have a fully fledged Exchange 2010 mailbox.

This is accessed using the https://mail.uctrial.com URL.

One of the nicest things here is that you can start sending IMs immediately by using the integrated IM functionality. Obviously this is not as feature rich as Office Communicator or even Communicator Web Access but it gets you started. Another new addition is the ability to see presence within OWA as can be seen in the email and top right of the screenshot below:

image

In my previous post on this subject I showed the process of logging into Office Communicator. Having done so I started poking around, and the first thing I tried was adding a federated user.

This gave me the following error:

image

The link for more info pointed here:

http://office.microsoft.com/client/helppreview.aspx?AssetID=HA103556171033&ns=COMM2007R2&lcid=1033

I then tried to add a friend at Microsoft – Brett Johnson

Surprisingly this worked as can be seen below, the globe icon shows up next to Brett which means that Federation is working for users at Microsoft but not external domains.

image

I then tried a bunch of other UC functionality such as desktop sharing, and peer to peer voice calls. Everything worked well! Sadly, one thing that is not available is Enterprise Voice which means that you can’t go making phone calls on the system.

One major thing that is really important to understand is that this is a multi tenant system on which you can see all the other accounts that people have created! There is NO segregation at all!!

So all in all this is a great service for anyone wanting to test out the full range of Microsoft UC functionality minus of course Enterprise Voice.

Cheers

Nathan


Exchange 2010 Storage Improvement

In the last couple of weeks I’ve been putting together a couple of presentations for the Dimension Data Next Generation Messaging launch which is focussed on moving people on from Exchange 2003.

The webcasts will be online soon and when they are I will put up a link.

However, in the mean time here are some of the resources I used whilst preparing the deck/session on Exchange 2010 Storage Improvements.

The biggest thanks, help came from Matt Gossage and his presentation from TechED US 2009. Matt is the Product Manager responsible for storage at Microsoft and did a great job explaining things!

http://www.msteched.com/online/view.aspx?tid=37c931bf-db0c-40d6-9cd5-8a3fb468ac8d

Obviously also inspired by that presentation was Mahmoud Magdy who works for Enow Consulting. He put together a three article series on Exchange 2010 storage here:

http://www.enowconsulting.com/ese/2010/01/understanding-exchange-2010-storage.html

http://www.enowconsulting.com/ese/2010/01/understanding-exchange-2010-storage_19.html

http://www.enowconsulting.com/ese/2010/03/understanding-exchange-2010-storage.html

On top of the above there are clearly numerous resources some of the most useful were:

Mailbox Server Storage Design:

http://technet.microsoft.com/en-us/library/dd346703.aspx

The Exchange 2010 Large Mailbox Vision Whitepaper

http://www.microsoft.com/downloads/details.aspx?FamilyID=e3303d34-af6c-4108-861b-dc05f9cf3e76&displaylang=en

Dude, Where’s my single instance?

http://msexchangeteam.com/archive/2010/02/22/454051.aspx

 

All in all hopefully that is a useful list and that you might also find my deck below useful.

 

Cheers

Nathan


Opening the OCS Help File gives HTML blocked content error

I’ve been doing a bunch of work recently with OCS in various lab scenarios and am really pleased that the OCS product group have bundled all their documentation into a CHM file like the Exchange team have done for a while.

The only weird thing about using the downloaded help file (see link below)

http://www.microsoft.com/downloads/details.aspx?familyid=E9F86F96-AA09-4DCA-9088-F64B4F01C703&displaylang=en#filelist 

is that on opening it, it doesn’t show content instead giving an error message as shown below:

829b7c1f-c52b-4c3f-a645-2182d395aa7c

So what it turns out, is that this only happens when you download the CHM file directly because when doing that, you are prompted about the possible security threat from opening it.

To get around this, I uncheck the box to always prompt on opening this type of file;

8e090f65-01bc-441f-9973-76658698dadd

at which point, the CHM file works correctly.

7f1b210b-f571-490f-8846-cf58b0a75104

Hope that helps someone.

Cheers

Nathan


Virtualizing Exchange

Hi,

Not much insight here I know, but I was researching this topic for a friend today and thought the collection of links might at least be useful!

Microsoft Virtualization: Best Choice for Exchange Server

http://msexchangeteam.com/archive/2009/09/03/452309.aspx

Should You Virtualize Exchange 2007 SP1?

http://technet.microsoft.com/en-us/library/dd535371(EXCHG.80).aspx

Exchange 2010 System Requirements

http://technet.microsoft.com/en-us/library/aa996719.aspx

Microsoft Support Policies and Recommendations for Exchange Servers in Hardware Virtualization Environments

http://technet.microsoft.com/en-us/library/cc794548(EXCHG.80).aspx

TechNet Webcast – Microsoft Virtualisation Best Practices for Exchange Server (Level 300)

https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032428204&CountryCode=US

Cheers

Nathan