Thursday, August 21, 2008

Counting Mailboxes and Determining Store Sizes

To obtain a breakdown of mailbox counts for each mailbox database in the Exchange organization:
Get-MailboxDatabase | Get-MailboxStatistics | Group-Object -property:database | Sort-Object -property:count | Format-Table count, name -AutoSize


To obtain a count of mailboxes per server:
Get-MailboxDatabase | Get-MailboxStatistics | Group-Object -property:serverName | Sort-Object -property:count | Format-Table count, name -AutoSize


To obtain the total number of mailboxes in your Exchange organization:
Get-MailboxDatabase | Get-MailboxStatistics | Group-Object


(Omitting the Get-MailboxDatabase command will give the count for the current server.)

These examples are wonderful illustrations of the usefulness of the Group-Object cmdlet.

I don't recall where on the web I found it, but the following commands will provide a breakdown of the sizes of all mailbox databases in the organization:
$exchangeservers = Get-ExchangeServer |where-object {$_.admindisplayversion.major -eq 8 -and $_.IsMailboxServer -eq $true }
foreach ($server in $exchangeservers)
{
$db = Get-MailboxDatabase -server $server
foreach ($objItem in $db)
{
$edbfilepath = $objItem.edbfilepath
$path = "`\`\" + $server + "`\" + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + "$" + $objItem.EdbFilePath.PathName.Remove(0,2)
$dbsize = Get-ChildItem $path
$ReturnedObj = New-Object PSObject
$ReturnedObj | Add-Member NoteProperty -Name "Server\StorageGroup\Database" -Value $objItem.Identity
$ReturnedObj | Add-Member NoteProperty -Name "Size (MB)" -Value ("{0:n2}" -f ($dbsize.Length/1024KB))
Write-Output $ReturnedObj
}
}

Thursday, August 14, 2008

Setting Send Connector Message Size Limits

For quite some time, our Exchange environment has been configured to restrict total message sizes to 30MB, as set in "Transport Settings" under the "Global Settings" tab of the Hub Transport settings. This limit was inherited from our Exchange 2003 settings, so we didn't have to configure it when we went to Exchange 2007. However, we recently had a customer complain that outbound messages were bouncing when their size broke 10MB. I was quite puzzled by this until they passed along a copy of the bounce message, which contained the following:

#550 5.3.4 ROUTING.SizeLimit; message size exceeds fixed maximum size for route ##

Ah ha! Lo and behold, Send Connectors have a default message size limit of 10MB, and we didn't modify this when we created the Send Connector for our 2007 Hub Transport servers. This is easily correctable, either via EMC, or via the following EMS command:

Set-SendConnector 'Connector Name' -maxmessagesize 30MB

Monday, August 11, 2008

Photographic Proof That UT Has Balls!

UT Austin is installing around campus a series of sculptures on loan from the Metropolitan Museum of Art in New York. This one in particular is being put up right in front of the building where I work.


I do not know the title or artist of this piece (installation is still in progress, so no plaque is in place), but it consists (thus far) of two large metal spheres covered with pennies, heads-up on one, tails-up on the other.

I can't help but wonder how long it will take the Powers That Be to notice the unfortunately suggestive placement.

Friday, August 8, 2008

Export-Mailbox Command Crashing PowerShell on Vista - Resolved!

I've been going back and forth with Microsoft on an issue that has been bugging me for a while. Whenever I try to use the Export-Mailbox command on my Vista workstation, PowerShell crashes. This is with a relatively new (less than one month old) Vista install and having re-installing PowerShell and the Exchange management tools. Yet, when I try it on a co-worker's workstation, it works fine.

Finally, Microsoft PSS hit on something that allowed me to find a workaround. After turning off UAC, I could run Export-Mailbox without it crashing PowerShell. Oddly enough, UAC is still active on my co-workers' workstations where I was able to successfully use the command, so the problem is clearly more complex.

Another clue from Microsoft: check the permissions on the registry key "HKLM\Software\Microsoft\Exchange\Exchange Migration". Based upon running TTTrace, I was getting an Access Denied error while trying to hit that key, resulting in the freeing of an internal structure needed to write data to the Application Event Log. The account I was using was a member of a group that was in the local Administrators group, which in turn had Full Control on that key. Perhaps that wasn't sufficient. I gave my account explicit Full Control on the key, turned UAC back on and rebooted. Export-Mailbox worked with UAC on.

Sigh....

Update A further clue: My co-workers were able to run in the command with UAC active and without explicitly giving themselves permissions on the registry key because they were running with elevated permissions, thus sidestepping UAC, whereas I was simply logging in directly to the workstation as the privileged user.

New Distribution Groups in Exchange 2007 Require Sender Authentication by Default

When a new distribution group is created in Exchange 2007, by default it is set to accept messages only from authenticated senders. A group can be set to not require authentication by using the Set-DistributionGroup command to set RequireSenderAuthenticationEnabled to $False.

To see what groups are set to require authentication, use the following command:

Get-DistributionGroup | where {$_.RequireSenderAuthenticationEnabled -eq $True}


Please note that the default settings also do not permit the object in the "Managed By" field to edit group membership.

Wednesday, August 6, 2008

New Blog for Boat Refit Project

I've been slowly making progress on my trimaran. I've built rudimentary supports to hold up the secondary floats while I detach them, and I've also procured an A-frame engine hoist via Craigslist for lifting the main hull. On top of everything else, this last Sunday, my friend Nyl brought up the plans from which the boat was built, along with a packet containing quotes and receipts from materials used in the original construction, an article written by the designer about boatbuilding on the cheap, a magazine article from 1968 about the controversy over multihull safety which cites the (then) recent disappearance of Arthur Piver, the man who designed my boat. Plus, a photo of my trimaran, in the water, back when it was new - sporting a cabin!

Sure enough, examining the schematics for the Piver Nugget revealed that it could be built in either a cabin or daysailer configuration. Finally knowing the name of the boat and its designer, I was able to locate numerous photos of other Nugget's on the web. It seems that most were built with the cabin configuration.

Anyway, I've now started a new blog over at http://piver-nugget.blogspot.com devoted to tracking my progress on this refit.

Friday, August 1, 2008

Coolest Exchange 2007 Tip Ever!

One of my biggest complaints about Exchange 2007 has been how long it takes for EMS and EMC to start up. This especially becomes an issue with web-based front-ends for PowerShell scripts, which have an unfortunate tendency to time-out.

Now there is a tip on the PowerShell Team Blog which explains how to pre-compile the .NET frameworks using ngen.exe to pre-populate the Native Image Cache, thus speeding up the loading of all things PowerShell-based. The performance gains are impressive, but I suspect that the script would need to be re-run anytime Exchange or the .NET Framework get updated or patched.

I also note that there doesn't seem to be much of a speed boost on the Exchange servers, just on other boxes that use EMS or EMC to manage Exchange. On our web front-end for self-service mailbox management, the EMS scripts run about twice as fast!