Matt Ellis

Get the active node of an Exchange 2007 CCR cluster using PowerShell…

Posted by in Exchange, PowerShell

There’s not a massively easy way of checking for the active node of a cluster without manually going into Failover Clustering or into the properties of the cluster in the EMC. Get-ClusteredMailboxServerStatus will give you the active node by getting the OperationalMachines attribute but if you’d like to use this in scripts or display it in a nice format then it’s not in the most helpful format (it’s an array). It usually looks something like this: {NODE1, NODE2 <Active, Quorum Owner>} Using the following script we can retrieve all the…read more

6

Get rid of trailing whitespace in DisplayName attribute…

Posted by in Exchange, PowerShell

Exchange 2007/2010 doesn’t like trailing whitespaces in the DisplayName of users. If a whitespace exists you will have issues when trying to manage the mailbox via EMC or EMS. This can be very annoying when you have automated systems that create users and append an annoying space to the end of the DisplayName. Here’s a command to find them and trim the whitespace off of the end of the DisplayName attribute: Get-Mailbox -Filter {DisplayName -like "* "} -ResultSize:Unlimited | ForEach {Set-Mailbox -Identity $_ -DisplayName&nbsp;$_.DisplayName.TrimEnd()}

0

Change a user’s ActiveSync policy back to take the Org default EAS policy…

Posted by in Exchange, PowerShell

By default, at the point of creation a user is created to take whatever is the organisation’s default policy. When this is changed to a specific EAS policy the ActiveSyncMailboxPolicyIsDefaulted property is changed to False. This can be annoying in the future as you may want them to revert back to the default policy for the organisation. This won’t happen is they’ve previously been assigned a specific EAS policy. To set the ActiveSyncMailboxPolicyIsDefaulted attribute back to true, just use the following command: Set-CASMailbox -Identity "USER-IDENTITY" -ActiveSyncMailboxPolicy:$null

0

How to upgrade an Exchange 2007 CCR cluster to SP3…

Posted by in Exchange, PowerShell

So, we finished upgrading the organisation to SP3 this morning. We had performed the upgrade to SP3 for the Client Access, Hub Transport and Edge Transport servers last week (as per MS best practice) which was a fairly simple process – you can just run the upgrade through a nice GUI by running the setup.exe. This week’s upgrade of all the clusters was still simple but does require a bit of different process. Hell, they’re clusters – what do you expect..? This process in this post is taken from http://technet.microsoft.com/en-us/library/bb676320(EXCHG.80).aspx…read more

0

Distribution Group Statistics…

Posted by in Exchange, PowerShell

So, I’ve been working on a script that gets a list of all mail enabled groups in the organisation and then queries each one to find out how many members there are (including members of nested groups etc.) It also shows which users and groups have permissions to send to each group and if it’s hidden from the GAL or not. The best (and easiest) way I could find to do this was to use the Quest ActiveRoles Management Shell Cmdlets. They’re free to use and can be downloaded from…read more

0

Exchange 2007 Message Tracking Across Multiple Hub Transport Servers…

Posted by in Exchange, PowerShell

Unfortunately, message tracking is a daily occurrence for me. Often someone has complained that their really important email hasn’t arrived (it always has – they just can’t find it) or you’ve just got some routing issues you need to sort out? Either way, you’ve probably stumbled across the console version of Exchange 2007 message tracking and been annoyed by the way you can only search across one server at a time. Annoying, I know. Like a lot of other things in Exchange 2007, Microsoft have included a lot more functionality…read more

0

Bulk add IP addresses to a Receive Connector…

Posted by in Exchange, PowerShell

If you’ve ever had to manually enter a large number of IP addresses into a Receive Connector in Exchange you’ll know how annoyingly boring this is. Fortunately, for you there is a much easier way. First, add all the IP addresses to a text file called list.txt The run the following script: 1 2 3 $ReceiveConnector = Get-ReceiveConnector "SERVERNAME\ReceiveConnectorName" Get-Content C:\list.txt | foreach {$ReceiveConnector.RemoteIPRanges += "$_"} Set-ReceiveConnector $ReceiveConnector -RemoteIPRanges $ReceiveConnector.RemoteIPRanges Good eh!?

2

Find all mailboxes hidden from the GAL…

Posted by in Exchange, PowerShell

I was asked the other day how we could find all mailboxes hidden from the GAL. This used to be pretty hard in Exchange 2003 but thanks to PowerShell this is now pretty easy. This command will get you every mailbox in your organisation that is hidden from the GAL. I’ve put the -ResultSize Unlimited value in there as your org is likely to be larger than 1000 mailboxes: Get-Mailbox -ResultSize Unlimited | Where {$_.HiddenFromAddressListsEnabled} You can obviously tailor this command to do what you like but it’s one example…read more

1

Configure mailbox database settings using PowerShell…

Posted by in Exchange, PowerShell

One thing I used to like about Exchange 2003 was System Policies. It made it easy when creating a new server with multiple stores to just chuck the server into the server policy and the stores into the appropriate mailbox store policy. Of course, Exchange 2007 did away with this. I understand the reasons – it just means you have to run a shell command a few times. This command sets everything you need on the mailbox database. Just adjust the settings to your organisations needs and change the –Identity…read more

0

OWA error caused by incorrect ExchangeVersion attribute…

Posted by in Exchange, PowerShell

When you migrate from Exchange 2003 to 2007/2010 one of the most time consuming things is re-educating the helpdesk and administration teams to use a different set of tools to do their daily job. In my experience they will still try to use the old tools and mistakes will be made. When an Exchange 2007/2010 user is created using the AD Users & Computers MMC snap-in (dsa.msc) instead of the Exchange 2007 Management Console/Shell all seems fine until the user tries to access OWA. In this instance they will see the…read more

0

Disable ActiveSync for all users…

Posted by in Exchange, PowerShell

I addition to yesterday’s post it may sometimes be necessary to disable ActiveSync for all users. This is a simple command and can obviously be customised to just disable users from a particular server or anything you like as long as it’s piped into the final command which will disable the feature. Get-Mailbox | Set-CASMailbox -ActiveSyncEnabled:$False Note: All users are created with ActiveSync enabled. There is no way to change this default. The best option is to use a template when creating new users or to script the hell out…read more

0

Find all users assigned to a particular ActiveSync policy…

Posted by in Exchange, PowerShell

So, I had to run a report on all users assigned to a particular ActiveSync policy today. This is how I managed to get it working: 1. Create a variable which specifies the policy name you want to report on: $ActiveSyncPolicyName = (Get-ActiveSyncMailboxPolicy "EnterActiveSyncPolicyNameHere").Identity.DistinguishedName Run the Get-CASMailbox shell command and use the variable we’ve just created to pull back the results: Get-CASMailbox -Filter {ActiveSyncMailboxPolicy -eq $ActiveSyncPolicyName} Simple, but effective.

0