Steve Goodman's Exchange Blog
8May/130

My latest KB articles on MSExchange.org

You’ll find great code snippets and short tips on MSExchange.org within the Knowledgebase section. My latest three are now available:

Reducing the Office 365 DirSync Schedule

Sometimes the default 3-hour DirSync schedule is not often enough. This quick tip explains how to reduce the sync schedule to something that better fits your organization:

Reducing the Office 365 DirSync Schedule

Performing Maintenance on Office 365 DirSync

After DirSync has been running for a while, advanced users who access the FIM GUI might notice that the logs start to increase in volume. This script shows you how to keep things under control:

Performing Maintenance on Office 365 DirSync

Scheduling an Exchange PowerShell Task

A quick simple tip here for anyone that needs to schedule an Exchange PowerShell script as a task. As you’ll see, it’s quite simple and easy, so if you need to regularly get a data export, this script is for you:

Scheduling an Exchange PowerShell Task

22Oct/1221

Exporting iOS 6.1 and earlier device information

Update 12th February 2013: Yep, iOS 6.1 and 6.1.1 are out and causing more issues, where a meeting request response can cause catastrophic transaction log growth by resubmitting the same request repeatedly to Exchange 2010. You’ll find more information at the following Microsoft KB article:

Rapid growth in transaction logs, CPU use, and memory consumption in Exchange Server 2010 when a user syncs a mailbox by using an iOS 6.1-based device

The scripts below identify all post-iOS 6 versions as well as earlier versions, so you can choose a course of action for iOS 6.1 and iOS 6.1.1 devices (even the “switch it on and switch it off again” solution proposed by Apple) and also warn users with pre-iOS 6.1 devices not to upgrade their devices.

Original Article

imageIf you’ve been following the Exchange and Apple-related news lately, you can’t have failed to hear about a number of bugs in the new iPhone, iPad and iPod Touch OS, iOS 6. No – I’m not talking about the dire Maps replacement, I’m talking about a few ActiveSync related bugs that have caused issues for a number of companies and we’re starting to hear about more and more in the wild.

What’s the problem, then? Well, in iOS the two most widely reported ones relate to:

  • AutoDiscover – It doesn’t work unless the Email Address and UPN match.
  • Meeting Requests – The iOS device loses track of the organizer and replaces the device user as the organizer instead, allowing the device user to update or cancel meetings other people have asked them to attend. For more info, see KB 2768774 

Some people have suggested a good solution to this is to block iOS 6, however I’m not so sure. As a consultant I’m on the road a lot, and if my device was blocked then I’d be in deep water – I rely on it to keep in touch with customers and colleagues when I’m out and about. So, I don’t think blocking an update that comes through semi-automatically will win Exchange administrators any friends within their business.

Another method you might want to consider is to find those iOS 6 users within your organization and tell them about the issue. It might not be practical in all situations, but with the help of the script below (which will also report future and previous versions) you’ll be able to see what the task in hand looks like.

Use the script as follows:

.\Export-iOSDeviceStatistics.ps1 -OutputCSVFile .\output.csv


You’ll see output about iOS devices shown in the PowerShell session:

image

And the resulting CSV file can be opened in Microsoft Excel, or your favourite CSV editor:

image

Download my script from the Technet Gallery

13Jul/123

Updating AD Usernames to FirstName.LastName format

Here’s a quick script for updating usernames from whatever format they’re in at the moment to a firstname.lastname format, based on their current First Name  and Last Name attributes in Active Directory.

The script can be used a few different ways – first, let’s have a quick look at how it can be used against a single user, firstly in test mode:

.\Update-Username.ps1 -Username steve -UPNSuffix exchangelabs.co.uk -WhatIf

image

Then for real by removing the –WhatIf parameter:

image

Next, let’s have a look how it can be used en-mass. We’ll create a text file with a list of users:

image

Then use the Get-Content cmdlet to suck in our users.txt file and user a foreach loop to test the command against all the users in that file. We’ll also log to a file called changes.txt:

Get-Content .\users.txt | foreach { .\Update-Username.ps1 –Username $_ –UPNSuffix exchangelabs.co.uk -LogFile .\changes.txt -WhatIf }

image

As before, we can run the script again without –Whatif and make the changes proposed for real:

image

Download the script from the Technet Gallery..

Filed under: Powershell 3 Comments
18Jun/121

Upcoming video course – MS Exchange PowerShell Techniques

photoSome good news if you’re eager to learn about PowerShell for Microsoft Exchange and don’t know where to start. One of my latest projects is, with my publisher Packt publishing, to produce a video-based course about Exchange PowerShell.

If you’ve enjoyed some of the scripts on my website, and want to be able to write your own, then this will definitely be for you. Over the course, which is divided into easy to digest pieces, I’ll take you from first steps with Exchange PowerShell, through key script writing concepts up to a point where you’ll be able to write complex Exchange PowerShell scripts yourself!

A release date isn’t set yet, but I’m anticipating mid-July to early August. Naturally, I’ll keep you posted when it’s available Smile

In the meantime if you’re looking for a fantastic Exchange PowerShell book – check out Mike Pfieffer’s Exchange 2010 PowerShell Cookbook for recipes for great PowerShell scripts, or Paul Cunningham’s Exchange Server Pro Exchange Server Boot Camps.

1May/128

Enabling a Remote Mailbox on Office 365 fails

I came across this issue last week, and to be honest was a little surprised. I’m sure I’d used it before, probably before Exchange 2010 SP2, so just expected it to work.

Let’s say you’ve built a Hybrid Exchange 2010 SP2 / Office 365 environment. You create a user, using your provisioning tool of choice – for this example we’ll say Active Directory Users and Computers:

image

So generally, running Enable-RemoteMailbox should work, in the same way running Enable-Mailbox should work too – all the components in Exchange are configured correctly, and if you create a mailbox using New-RemoteMailbox or the Exchange Management Console everything works.

However, the following happens:

image

The error – for the purposes of people searching for it is The Address @tenant.mail.onmicrosoft.com is invalid: “@tenant.mail.onmicrosoft.com” isn’t a valid SMTP address. The domain name can’t contain spaces and it has to have a prefix and a suffix, such as example.com. FullyQualifiedErrorID : F0109C5E,Microsoft.Exchange.Management.Recipient.Tasks.EnableRemoteMailbox.

I did a quick search on the net, and didn’t find any answers however I did find someone having the same problem. Sadly they hadn’t had much luck with forum support or Office 365 support.. So I had a little bit more of a look into the issue and found that the solution in most cases should be fairly simple.

When enabling the remote mailbox, use the –RemoteRoutingAddress parameter, specifying your alias and service domain/Office 365 tenant, for example:

Enable-RemoteMailbox <username> -RemoteRoutingAddress <alias>@<tenantName>.mail.onmicrosoft.com

After using the command as shown above, the remote mailbox should be created and thus provisioned correctly by DirSync:

image

A few points of note in addition – if you’ve configured your Hybrid organization the “old” way – i.e. you’ve got a service domain, replace the above <tenantName>.mail.onmicrosoft.com with your chosen Service Domain (i.e. service.contoso.com). And the original poster to the question I answered on TechNet found in his environment, he needed to use the –Alias parameter also to get things moving.

Hope this helps Smile

Steve