North East Bytes - a Microsoft technology usergroup in North East England.

Tweets

Powered by Squarespace

Entries in exchange (8)

Thursday
Jun252009

HTC Hero: first Android phone to ship (in the UK) with Exchange Active Sync

[UPDATE] Thanks to cr0vax for pointing out in the comments that the HTC Android phones that are not badged "with Google" have already got Exchange functionality, but those versions haven't been released for the UK market, so I've added "in the UK" to the title.

Yesterday HTC held a press event in London to announce their new Android phone, the Hero. The phone looks, both on paper and in the released photos and videos, fantastic. The Sense UI that HTC have built on top of the Google Android OS looks very nice and has some features that appeal to me, such as the widget for Twitter.

The thing that I find most interesting about the phone though is that it appears to be the first Android device to ship with Exchange Active Sync support. Since I use Exchange as my primary mail platfrom, the less than stellar support for Exchange is the thing that has steered me away from Android up to now, but HTC know very well how much it's used and seem to have sorted it out.

I haven't seen anything written about this (although I have just asked HTC), but if you look at various videos showing the device, it's there. The first thing I noticed was in the "First Look" video that HTC released on their YouTube channel...

...at 3:44 in the video, you can see that the email application has "Exchange" across the top of the screen as the different views of the mailbox are displayed. Of course that could just be an account setup to use IMAP to talk to an Exchange server that has been labeled as "Exchange", so it wasn't exactly proof of Active Sync.

After more digging around, I found the proof in a video from SlashGear.TV...

...with 7:20 to go in that video, the guy doing the demo is setting up a mail widget and selects which mail account he wants to display - one of the options on the screen is "Exchange ActiveSync". Following on, with 5:30 to go, he explains that you get to sync your mail, calendar and contacts. Happy days!

I haven't had much of a play with Android, but I understand that until now the best option for connecting to Exchange was TouchDown, which I'm told it perfectly decent (from the screens I've seen I was surprised to hear that, but I can't pass comment without trying it). Personally though, I'm happier knowing that something as important to me as Exchange is going to be built in and therefore fully integrated into the device.

Of course, we don't know yet how complete the support is (it seems the Palm Pre launched with some Exchange issues), but if I had to put my money on one company to get it right, it would be HTC. I'm really looking forward to reading the reviews of this device in the short run up to it shipping next month.

[UPDATE] Amazon UK now have the Hero available to order.

Sunday
Apr052009

VBUG Newcastle IT Pro Event 14th May: Unified Communications with Eileen Brown

For the second VBUG Newcastle IT Pro event, we're fortunate to have a great speaker. Eileen Brown is the manager of Microsoft's TechNet UK IT Professional Evangelist Team, and writes a hugely popular blog on Management, Messaging, Mobility and Real Time Collaboration.

Here's the overview of Eileen's talk:

"If the PCs on our desks do much more than they did 10 years ago, why don't our phones ?

On a Mobile phone calls are dialled from your phone book - UC allows your PC contacts to be used to place calls rather than re-keying the number into a desk, and identifies your contacts by name when they call you and routes your calls to the best phone. Unified communications is bringing together Voice, Fax, Video, Email and Instant messaging, into one system. So Voice mail which arrives in your mailbox And e-mail which can be read to you over the phone. With UC you can see if someone is around to take a call or answer a message before you contact them - and choose the best medium. And a conversation can move seamlessly from email, to instant message, to data sharing and video conference. Harnessing UC can mean less travel, less frustration and greater productivity."

The presentation will take place in Room 118 of Claremont Tower, Newcastle University on Thursday 14th May, 18:30 (for a 19:00 start). If you plan to attend, please could you sign up at the VBUG site (just so we have numbers for refreshments, etc): http://www.vbug.co.uk/Events/May-2009/VBUG-Newcastle-Unified-Communications-with-Eileen-Brown.aspx

You don't have to be a VBUG member and the event is free to attend.

If you're on Twitter, you might like to follow Eileen.

Thursday
Nov272008

Finding the GUID of an Exchange 2003 mailbox database

We’ve just had an issue where we needed to know the GUID of a mailbox database on an Exchange 2003 server (in order to make a registry tweak in a hive named with the GUID and nothing which indicates the friendly name).

With Exchange 2007 it’s easy to do this using the Get-MailboxDatabase PowerShell cmdlet in the Exchange Management Shell:

Get-MailboxDatabase "Ex07Server\Storage Group 1\Mailbox Database 1" | Select Guid

However, if you try to do this against a database on Exchange 2003, you get an error from Get-MailboxDatabase saying the server is running Microsoft Exchange 2003 or earlier, which it doesn’t support.

You can use the Get-Mailbox cmdlet against an Exchange 2003 server though. This returns an object of the type Microsoft.Exchange.Data.Directory.Management.Mailbox and it has a Database property. If you output this property, using a formatting cmdlet on the Get-Mailbox, you’ll get the name of the database, but looking closer with Get-Member reveals that the Database property is not just the name, but an object, which you can get at with this:

(get-mailbox -database "Ex03Server\Storage Group 1\Mailbox Database 1" | select -first 1).database

This doesn’t give you quite as much as Get-MailboxDatabase does for an Exchange 2007 database, but it does include an ObjectGuid property, which was exactly what we needed to identify the correct hive in the registry on the Exchange 2003 server.

Monday
Sep082008

Enumerate Exchange Public Folder Client Permissions for a User/Group

Today I've been consolidating some AD groups as we've unhelpfully accumulated four different groups for the members of our IT department over the years. Seemingly two of these groups have been used to set permissions on various Exchange Public Folders, so I've been looking at which Public Folders each group had permission on. Fortunately, this is very easy to do in PowerShell...

First I'm setting a couple of variables. The first is the name of the group (or you could do the same for a user) that we're interested in. The second is the point in the Public Folder structure where we're starting searching. If you want to look at the whole structure, just use "\", but if you have a lot of Public Folders that's going to take a while, and if you know, like I did here, that the "IT Staff" group is only going to have permissions on folders underneath the IT department's top level folder, you can just look at that branch of the tree.

#requires -pssnapin Microsoft.Exchange.Management.PowerShell.Admin
$groupname = "IT Staff"
$publicfoldersearchroot = "\IT"
get
-publicfolder $publicfoldersearchroot -Recurse |
%{$folder = "$($_.parentpath)\$($_.name)";
Get
-PublicFolderClientPermission $_ |
%{if($_.user -match $groupname){"$folder ($($_.AccessRights))"}}}

 

This results in output like this:

 


\\IT (Reviewer)
\IT\Admin\Health&Safety (Reviewer)
\IT\Admin\Forms (Reviewer)
\IT\Admin\Forms\Payroll (FolderVisible)
\IT\Customer Services (Reviewer)
\IT\Customer Services\Projects (Reviewer)
\IT\Equipment Bookings (Author)
\IT\General Information (PublishingAuthor)
\IT\Mail Lists (Reviewer)

 

This might be all you need, although if you're going to do something programmatically with the output (you'll want to format it differently, but...) be careful with that double \ on the first line of the output. It's there because the parentpath is "\". It's easy enough to trap and remove it.

Thursday
Jul242008

Spreading Exchange 2007 mailboxes between databases with PowerShell

At this time every year, I have to arrange the provisioning of Active Directory user accounts and Exchange mailboxes for thousands of students. This year, I'm completing the whole of that process using Windows PowerShell. This means spreading them evenly over a set of Exchange mailbox databases.

The first step in this is finding out how many mailboxes are already in each database, which I'm doing like this:

#requires -pssnapin Microsoft.Exchange.Management.PowerShell.Admin
$mailboxcount = @{}
Get-MailboxDatabase -Server EXSRV02 | ?{$_.recovery -eq $FALSE} | `
%{$mailboxcount["$($_.storagegroup)\$($_.name)"] = 0;
Get-Mailbox -Database $_ -ResultSize Unlimited | `
%{$mailboxcount["$($_.database)"]++}}
$mailboxcount.GetEnumerator() | sort name

Breaking that down...

I'm not actually running this in the Exchange Management Shell. My profile imports the necessary Exchange snapin to the standard shell (along with a few other things), but I'm just checking that it's registered first by using the #requires statement because otherwise we wouldn't get very far (see my friend Aleksandar's post on #requires for more explanation).

Then we declare an empty hashtable, $mailboxcount, which we're going to use to hold the mailbox databases and the number of mailboxes in each.

In my example script, I'm specifying a server name to the Get-MailboxDatabase cmdlet, but you could equally leave off the -server parameter, which will get all of the mailbox stores (databases) in your Exchange 2007 environment. You could also specify a set of servers by reading them from a file, or passing an array of strings containing server names, to the get-mailboxserver cmdlet and then into get-mailboxdatabase like this:

get-content mailboxserver.txt | get-mailboxserver | get-mailboxdatabase

or

"EXSRV01","EXSRV02" | getmailboxserver | get-mailboxdatabase

That gets all of the databases on the servers that we want to look at, but it also includes Recovery Storage Groups, so we're filtering those out by piping our mailbox databases through...

?{$_.recovery -eq $FALSE}

Next, we're piping each database into a script block by using the foreach-object cmdlet (aliased to %). This script block contains two lines of PowerShell, separated with a semi-colon. The first populates the $mailboxcount hashtable with each of the database names. It does it in a slightly strange manner: $($_.storagegroup)\$($_.name) because this the same format as we'll get from the mailbox's database property and we need them to match up, and also because this produces the most useful output - SERVERNAME\STORAGEGROUP\DATABASE. We're assigning each database an initial value of 0.

That line may be optional to you, depending on how you want this to work. If you want to see any empty databases, you need it in there, but if you've added a new database you're not quite ready to use just yet, you can leave it out and the empty database will be left out of your results (and therefore the allocations in the next phase).

The next line uses the Get-Mailbox cmdlet, specifying the -database parameter to return all the mailboxes for the current database and these are passed down the pipeline to increment the value for that database in the hashtable with

mailboxcount["$($_.database)"]++

The mailbox's database property is enclosed in $() so that it is evaluated before it's treat as the key string, otherwise you'd end up with a hashtable full of MAILBOXNAME.database, with a value of 1. That part of the script takes longer the more mailboxes you have.

That done, we're displaying the contents of the hashtable, which is better viewed sorted, so we're using the GetEnumerator method and sorting by name to get something like:

Name                           Value
----                           -----
EXSRV02\SG01\MS01              199
EXSRV02\SG02\MS02              201
EXSRV02\SG03\MS03              199
EXSRV02\SG04\MS04              200
EXSRV02\SG05\MS05              189
EXSRV02\SG06\MS06              188
EXSRV02\SG07\MS07              200
EXSRV02\SG08\MS08              172
EXSRV02\SG09\MS09              195
EXSRV02\SG10\MS10              183
EXSRV02\SG11\MS11              77

Alternatively, you can sort by value to see the most used databases by using

$mailboxcount.GetEnumerator() | sort value -desc

which will show largest down to smallest, like this:

Name                           Value
----                           -----
EXSRV02\SG02\MS02              201
EXSRV02\SG07\MS07              200
EXSRV02\SG04\MS04              200
EXSRV02\SG01\MS01              199
EXSRV02\SG03\MS03              199
EXSRV02\SG09\MS09              195
EXSRV02\SG05\MS05              189
EXSRV02\SG06\MS06              188
EXSRV02\SG10\MS10              183
EXSRV02\SG08\MS08              172
EXSRV02\SG11\MS11              77

That's a useful script for seeing how many mailboxes are in each database, although you may want to discount the disconnected mailboxes, i.e. those that are waiting to be purged because their associated user object has been deleted (see my earlier post about orphaned mailboxes).

Now on to adding new mailboxes...

Now that we've got that hashtable, we don't need to query the system again for this round of provisioning. All we're going to do is, for each new mailbox we create, grab the database with the fewest mailboxes, increment the value in the hashtable, like so...

$mbdatabase = ($mailboxcount.GetEnumerator() | sort value | select -first 1).key
$mailboxcount[$mbdatabase]++

and this gives us the database to use for the new mailbox in our variable
$mbdatabase, which we can give to the Database parameter of the New-Mailbox cmdlet, which will create the mailbox AND the user object for us, or the Enable-Mailbox cmdlet, which will give a mailbox to an existing user.

[UPDATE]

Scott Bueffel contacted me to say that he's written a new version of this code to work in his large Exchange environment which is far quicker to run as a result of using bypassing the Exchange cmdlets to get the minimum amount of data count the mailboxes and just update the hash table. I'd recommend checking out his post.

I'm not so worried about the speed because these days I'm just rebuilding that hash table once a week and saving it in a file which the mailbox creation script reads and updates as it adds more mailboxes. I still need to re-do the counts in full because our current method of user/mailbox removal doesn't update the counts. If I remember correctly, it was /\/\o\/\/'s suggestion to store the hash table in a file, but if I'm wrong and someone else deserves the credit, get in touch.