# This script will return the smallest mailbox database, which can be useful when creating new mailboxes or re-distributing based on size
# Created by Jason Sherry (izzy@izzy.org) 3/25/2012
# Last Updated: 6/16/2012
# Source: http://izzy.org/scripts/Exchange/Admin/Get-SmallestDB.ps1
# Partial code source: http://powershell.com/cs/media/p/3981.aspx
$MBXDbs = Get-MailboxDatabase | Where-Object {$_.Identity -notlike "TCN-EU-*"} # This will exclude any DB that started with "TCN-EU-"
# Loop through each of the MBXDbs
ForEach ($MBXDB in $MBXDbs) {
# Get current mailboxes sizes by summing the size of all mailboxes and "Deleted Items" in the database
$TotalItemSize = Get-MailboxStatistics -Database $MBXDB | %{$_.TotalItemSize.Value.ToMB()} | Measure-Object -sum
$TotalDeletedItemSize = Get-MailboxStatistics -Database $MBXDB.DistinguishedName | %{$_.TotalDeletedItemSize.Value.ToMB()} | Measure-Object -sum
#Get-MailboxDatabase and the DatabaseSize property was not used since it does not return a value in some environments as of 2010 SP2
$TotalDBSize = $TotalItemSize.Sum + $TotalDeletedItemSize.Sum
# Compare the sizes to find the smallest DB
If (($TotalDBSize -lt $SmallestDBsize) -or ($SmallestDBsize -eq $null))
{
$SmallestDBsize = $TotalDBSize
$SmallestDB = $MBXDB
}
}
Write-host "Smallest DB: " $SmallestDB
Script to return smallest Exchange MBX DB size
Script to reassign mailbox to a new user
In some organizations when a user leaves the company or is moved to a new role their existing mailbox needs to be reassigned to their replacement. In other words, the mailbox belongs to the role and not the person.
If you just disabled the mailbox many Exchange properties are lost, include the e-mail addresses and LegacyExchangeDN address (which is used by Outlook and stored in the Outlook nickname cache for message delivery). So these addresses need to be manually copied to the new mailbox, the LegacyExchangeDN needs to be added as an X.500 (X500) address to allow users to reply to past messages from the mailbox and to prevent message delivery issues when using Outlook.
So I created this script to simplify the process.
Script: Reassign-Mailbox.ps1
#******************************************************************************************
# Created by Jason Sherry (izzy@izzy.org) 3/15/2012
#
# Copies an existing mailbox properties and reassigns it to a new user and restores properties after reassigning
# Source: http://izzy.org/scripts/Exchange/Admin/Reassign-Mailbox.ps1
#Import-Module ActiveDirectory # Only needed if copying groups, which script doesn't support yet
param(
[Parameter(Mandatory = $true)]
[String]$CurrentUser,
[Parameter(Mandatory = $true)]
[String]$NewUser
)
Try {
$Mailbox = Get-Mailbox $CurrentUser -ErrorAction Stop
Write-Host "Got mailbox info for" $Mailbox.DisplayName
# $Groups = (GET-ADUSER -Identity $CurrentUser-Properties MemberOf | Select-Object MemberOf).MemberOf
}
Catch {
"Error:" ; $error[0].Exception.Message
return
}
Write-Host "Existing Mailbox Details:"
$MBXStats = get-mailboxstatistics $Mailbox | select *
$MBXStats
#$MBXPerms = get-mailboxpermission $Mailbox | select *
#$MBXPerms
Disable-Mailbox $Mailbox.alias -confirm:$false
Write-Host "Waiting 15 seconds for cache refresh"
start-sleep 15
Connect-Mailbox $Mailbox.exchangeguid -database $Mailbox.database -Alias $Mailbox.mailnickname -user $NewUser
$NewMailbox = Get-Mailbox $NewUser
$Mailbox.EmailAddresses += [Microsoft.Exchange.Data.CustomProxyAddress]("X500:" + $Mailbox.legacyExchangeDN)
Set-Mailbox $NewMailbox.identity -emailaddresspolicyenabled $False
Set-Mailbox $NewMailbox.identity -emailaddresses $Mailbox.emailaddresses
Set-Mailbox $NewMailbox.identity -emailaddresspolicyenabled $True
#******************************************************************************************
Usage:
.\Reassign-Mailbox.ps1
Example:
.\Reassign-Mailbox.ps1 JohnDoe JaneDoe
The above example would do the following:
1. Copy the e-mail addresses from the JohnDoe
2. Disconnect the mailbox from this account JohnDoe
Note: When a mailbox is disconnected many properties for the mailbox are lost, include the e-mail addresses for it. The script copies the mailbox information to a variable first to prevent the loss of these properties.
3. Reconnect the mailbox to JaneDoe
4. Copy the e-mail addresses and X500 address into the newly reattached mailbox for JaneDoe
MEC is BACK in 2012!
8/17 Update: I will be hosting two sessions at MEC this year, see this blog post for more info: https://blog.jasonsherry.net/2012/08/17/speaking-at-mec-2012/
I first started working with Microsoft Exchange during the beta of 4.0 while at Digital Equipment Corporation in late 1995. My team, PC application support, used it to communicate internally, instead of the VAX Mail. After leaving DEC in 1996 one of my first real Exchange projects was migrating 160 MS Mail post offices to Exchange 5.0. From this point forward my primary focus and passion, for the last 16 years, has been on Exchange.
I didn’t make the 1st MEC in 1997 (San Diego, CA) or the 2nd one in 1998 (Boston, MA) but I did make Atlanta, where I was living at the time, in 1999. I was working for Mission Critical Software (acquired by NetIQ in 2000) as a System Engineer (technical sale person) selling a roles-based delegated administration product for Windows NT 4.0 and Exchange 5.5. (It took Microsoft 11 years to provide the same support in Exchange 2010 with RBAC.)
The MEC was a very special event since almost everyone was there to learn about Exchange and solutions that would help deploy or manage it. It was like a geek fest with a single focus and it was also pre-bubble burst. I in sales at the time and didn’t have to worry much about expenses, so I took my peers and co-works on a tour around some of the more interesting places in Atlanta after the sessions were done for the day. During the day the sessions started off a bit slow as I recovered from the previous night but I quickly woke up as the energy in the rooms and conference as a whole increased throughout the day.
In 1999 people were still excited about SMTP based message transfer (still pretty new in the late 90s and provided 1st in 5.0), Outlook Web Access (new to Exchange 5.0, Netscape Mail was one of the only off the shelf web based e-mail solution until this time, calendaring support came in 5.5), the new clustering support in Exchange 5.5 (two nodes only, but was rarely used), and support for larger than 16GB database. Exchange was still very new at this time and people were excited to get off MS Mail, Lotus Notes, and various other solutions to one that was much more scalable, flexible, and easier to manage. I also went to MEC 2000 in Dallas, TX which had a big buzz around an integrated directory (Active Directory) with Exchange and Windows 2000 and the complexities of migrating from 5.5’s dedicated LDAP directory. By this time I was a product manager at NetIQ and was focuses on developing management and migration solutions for Windows NT, Windows 2000, and Exchange.
What really made MEC stand apart was that you could walk up to any group and chances are they were talking about Exchange. There were great sessions/round tables, in prompt to meetings, vendor presentations, and just a passion about Exchange. The energy, focus, and excitement was great.
Sadly MEC ended in 2001, I assume this was so Microsoft could reduce their event budget and focus mainly on TechEd. TechEd might be great for the generalist but for someone who focused on Exchange TechEd provide doesn’t tend to provide too much new or very technical content since the sessions are normally for 100s or 1,000s of people. At MEC the sessions were very small to maybe 50 or so. This allowed the topics to be very technical or high level and the audience got want they wanted. I expect this to return in 2012. For the last 10 years there have been other conferences that had a good focus on Exchange but they weren’t the same as MEC.
I’m looking very forward to MEC 2012 (9/24/2012) in Orland, FL for three main reasons. The community of people that will be there, second presenting and sharing my experience and helping others, and finally I hope it will help re-vitalizing the Exchange community. I also hope to get some new business out of MEC. I’ve been doing independent consulting work now for a year, with a friend at Pro Exchange, and it’s been a GREAT change from working for others. But since we don’t have sales and marketing we get most of my business via word of mouth and from other consulting companies.
Hope to see you at MEC 2012 in Orlando and look me up at http://jasonsherry.org if you need one of top Exchange consultants and one of only 20 Exchange MVPs in the US.
Related Posts
Microsoft’s MEC info site: MECisBack.com – Content\details coming soon
Exchange Team EHLO Blog: MEC is Back!
Windows IT Pro: MEC returns in September 2012: the Exchange community applauds!
Tony Redmons’s Blog: I miss the Microsoft Exchange Conference (MEC)!
MEC History
1997 in San Diego, CA
1998 – Boston, MA (~4,000 attendees)
1999 – Atlanta, GA; Hamburg Germany; Tokyo, Japan
2000 – Dallas, TX; Nice, France; Tokyo, Japan; Singapore
2001– Orlando, FL; Nice, France
2012 – Orlando, FL
Looking for someone to mentor & train in the Microsoft Infrastructure area
Also posted on FB Here
I’m looking for someone to mentor & train in the Microsoft Infrastructure area, mainly Exchange, Active Directory, SharePoint, and scripting that lives in the Denver area. I could use a technical assistant for many things, like doc review, data gathering, Word and Excel work, and more.
Must be VERY proficient with Windows and preferably with Excel and Word. Some experience with Exchange, AD, SharePoint, Windows networking (TCP/IP), and scripting would be a major bonus, but not required. Must be a self-learned, ie be happy to go off and research and try things out on your own time. Must live in the Denver area and be willing to work from my condo in Denver, at least initially. I do 95% of my work remote and once you are up to speed you can do the same.
You will be assisting me on some projects and with personal items. If you have a resume great, send it to me (izzy@izzy.org) if you are fresh out of or in High School or college and don’t that’s fine too.
Pay
You will be paid via 1099, this means you will need to claim this income on taxes and I’ll be claiming you as an contractor/expense.
Depending upon your skills, $20-50/hr or more if you have really good skills and I can delegate tasks to you.
Hours: 4-12 initally
Technology you will be working with
A lot:
Microsoft Office – Mainly Word, Excel, and Outlook
Microsoft Exchange 2003-2010
Microsoft Windows 2003-2008 Networking & DNS
Microsoft Active Directory
Remote Desktop software
VPN software
Some:
Microsoft SharePoint 2007-2010
Mint.com (Personal finance tracking website)
Freshbooks.com (Business time tracking and website)
WordPress.com (Blog website, need to move my blog from SharePoint to Word Press)
Microsoft Windows 2003-2008 DHCP, DFS, file sharing,
Must Have Experience
Microsoft Windows
Love technology and learning new things
Microsoft Word & Excel
Nice to Haves Experience
Active Directory
Exchange
SharePoint
Microsoft Outlook
Scripting
Networking and TCP/IP
Things that you will be doing
Learning about Microsoft Infrastructure, Exchange, AD, and SharePoint
Connecting to remote machines to collect data
Processing and analyzing collected data using Excel
Setting up and analyzing performance counters
Review design, implementation, and transition/migration documents
Tracking your time and reporting on your time and mine
Assisting me with some persona data classification work
Migrating my blogs from SharePoint to Word Press
Setting up IIS redirects for old blog URLs to new ones
Carrying out Health Checks on client environments
When you are working on tasks I assign to you or we are spending time together going over technology you will be paid/on the clock. If I give you homework (not for a client or me)/research/reading items or you do research on your own this will not be paid.
If you want to know more about me goto: jasonsherry.org
Exchange 2010 SMTP Protocol Logging
Exchange 2007/2010 SMTP log format differs greatly from Exchange 2003, which used IIS for SMTP. There are now only nine fields in the logs and the last field, data, contains multiple parts of data that used to be in their own fields.
Example 1:
logparser “select REVERSEDNS(EXTRACT_PREFIX(remote-endpoint,0,’:’)) as RemoteSendingHost,data from RECV*.log Where data like’550%'” -i:csv -nSkipLines:4 -o:datagrid
· This example will return all entries that have an SMTP code of 550, using the GUI datagrid for output.
Example 2:
logparser “select REVERSEDNS(EXTRACT_PREFIX(remote-endpoint,0,’:’)) as RemoteSendingHost,data from RECV*.log Where data NOT like ‘250%’ AND data NOT like ‘220%’ AND Data NOT Like ‘221%’ AND event = ‘>'” -i:csv -nSkipLines:4 -o:datagrid
· This example returns results for any receive command, data line, that doesn’t start with 220, 221, or 250.
Results:

date-time – UTC date-time of the protocol events = second, fff = fractions of a second, and Z signifies Zulu, which is another way to denote UTC.
connector-id – Distinguished name (DN) of the connector associated with the SMTP event.
session-id – GUID that’s unique for each SMTP session but is the same for each event associated with that SMTP session.
sequence-number – Counter that starts at 0 and is incremented for each event in the same SMTP session.
local-endpoint – This consists of an IP address and TCP port number formatted as <IP address>:<port>.
remote-endpoint – This consists of an IP address and TCP port number formatted as <IP address>:<port>.
event – Single character that represents the protocol event. The possible values for the event are as follows:
+ Connect
– Disconnect
> Send
< Receive
* Information
data – Text information associated with the SMTP event.
context – Additional contextual information that may be associated with the SMTP event.
From: TechNet: Understanding Protocol Logging
Additional info
· EHLO: Advanced Exchange 2007 Transport Logs Troubleshooting using Log Parser – Part 1
· Using the Logparser Utility to Analyze Exchange/IIS Logs
· LogParsing with Exchange SMTP Protocol Log
· SMTP Log Parsing – Includes a script that ask for basic info and then calls LogParser and then color codes the output
· Examples: LogParser from MS – Format/fields have changed from 2003 & 2007, so these examples may not work on 2010
· Links and other info: Issues & Tips: MS log parser tool – Get data out of logs quickly!
Got my Microsoft Exchange MVP Reward\recognition for the 7th year
Got my Microsoft Exchange MVP reward\recognition for the 7th year.
It is an honor to be selected as a Microsoft MVP since there are 20 Exchange MVP in the US and 107 worldwide, as of 1/1/2012. In order to become an MVP you must be nominated by others in the technical community you work with, Microsoft employees, or other MVPs. Each year a panel of Microsoft employees reviews the contributions of each nominee for quality, quantity, and level of impact on the technical community.
So basically you have to write articles, blog post, or otherwise contribute to the technical community and be recognized for your work.
In order to keep your MVP status each year you must continue to contribute to the community every year.
Here’s what I did in 2011:
· My blog and other Exchange postings
o Technical Blog: http://info.izzy.org/Blog – 11 blogs posts on Exchange in 2011
§ ~61/request a day = ~1,800 hit per month
o Exchange tweeds: http://twitter.com/JasonSherry – 216 followers, 5 Exchange tweets in the last 90 days
o Tips & Tricks posted on my server for 2011 – 12 on Exchange, so far; 1 on Outlook
o TechNet Wiki postings: http://social.technet.microsoft.com/wiki/members/Jason-Sherry/activities/default.aspx
· MVP Community Work
o Attended 2011 MVP summit and participated in Q&A with Exchange product team
o Participation on Exchange MVP mailing list
o Participate on weekly\monthly Exchange 2010 and E15 calls with product and support teams
· Group\Admin leader on LinkedIn
o Microsoft Exchange: http://www.linkedin.com/groups?gid=90197 – 7,491 members (as of 10/18/2011, lots of growth from 2010)
o Exchange Archiving: http://www.linkedin.com/groups?gid=774507 – 201 Members
o Exchange MVPs: http://www.linkedin.com/groups?gid=90222 – 61 Members
· Member & Contributor of LinkedIn groups
o eLegal: http://www.linkedin.com/groups?gid=1320117 – 33,835 members
o Microsoft Exchange Migration: http://www.linkedin.com/groups?gid=1046597 – 1,125 Members
o Microsoft MVP – Professional Group: http://www.linkedin.com/groups?gid=794847 – 1,663 Members
· Did have much time to post in the forms this year (again)
o http://social.technet.microsoft.com/Profile/jason%20sherry/activity – Just 2 Exchange related posts
o Google search for “Exchange” posting in 2011 – Mostly buzz on past articles or scripts I’ve written (Bing doesn’t do date range filters)
· Maintaining script for the Exchange community:
o http://info.izzy.org/Wiki/EXCollect.aspx
§ Tracks Exchange activity over time (the data can be used as an input for the Microsoft Storage Calculator)
o http://info.izzy.org/Wiki/GetServerInfo.aspx (Released in 2011)
§ Gets HW, hotfix, and OS info from a list of servers
o http://info.izzy.org/Wiki/GetMailboxInfo.aspx (Released in 2011)
§ Get mailbox info (size, item count, etc) and user account info (multiple AD attributes)
Good blog post from Tony Redmond: The Sharing of Exchange MVPs
Microsoft Windows Live Mesh
- You can sync multiple folders on multiple local drives
Dropbox allows you to sync a single folder (called Dropbox by default) with an advanced option to choose subfolders within that folder. I use Windows Live Mesh to sync files stored in a multitude of folders, some in the Documents folder, others on a separate hard drive. And I can choose a different destination for the synced files on different PCs. - Windows Live Mesh offers more free storage
The space available in the free SkyDrive Synced Storage location is 5GB; Dropbox only offers 2GB for free. SkyDrive also offers 25GB of space that’s accessible through the web interface but not through Windows Live Mesh. Dropbox has a slight edge if you’re willing to pay for more storage, but the 5GB Windows Live Mesh limit is much less of a problem when you realize… - You can use Windows Live Mesh to sync between PCs without using the cloud
= Unlimited space across PCs\Macs
With Dropbox, everything you sync goes in your web-based storage locker. With Windows Live Mesh, SkyDrive Synced Storage is an option for any synced folder. If you leave it unselected, you can use your local network to sync the contents of a folder between two (or more) PCs or Macs, without ever taking a trip to the cloud. You can sync up to 200 folders, each up to 50 GB in size and containing up to 100,000 files, and because their contents are never stored in the cloud, you eliminate the risk of disclosing confidential information if your account is hacked.
Microsoft Live Mesh support PC, iPhone, Windows Mobile 7, Web, Mac OS 10.5+
The Music and Bands of 2011
For a list of shows and the rating I gave them for 2011 see: http://bit.ly/2011Shows
155 “Shows” aka acts\performances
136 Band
42 shows got a KICK ASS rating in 2011
19 Hours of music in this play list
4 Primus seen in 2011
3 Social Distortion, Galactic, Grace Potter and the Nocturnals, JJ Grey & Mofro, & Warren Haynes seen in 2011
Great EHLO post: Database Maintenance in Exchange 2010
This post: http://blogs.technet.com/b/exchange/archive/2011/12/14/database-maintenance-in-exchange-2010.aspx
Database Compaction
Database Defragmentation
Database Checksumming
Page Patching
Page Zeroing
Exchange 2010 SP2 is out
- Outlook Web App (OWA) Mini A browse-only version of OWA designed for low bandwidth and resolution devices. Based on the existing Exchange 2010 SP1 OWA infrastructure, this feature provides a simple text based interface to navigate the user’s mailbox and access to the global address list from a plurality of mobile devices.
- Cross-Site Silent Redirection for Outlook Web App With Service Pack 2, you will have the ability to enable silent redirection when CAS must redirect an OWA request to CAS infrastructure located in another Active Directory site. Silent redirection can also provide a single sign-on experience when Forms-Based Authentication is used.
- Hybrid Configuration Wizard Organizations can choose to deploy a hybrid scenario where some mailboxes are on-premises and some are in Exchange Online with Microsoft Office 365. Hybrid deployments may be needed for migrations taking place over weeks, months or indefinite timeframes. This wizard helps simplify the configuration of Exchange sharing features, like: calendar and free/busy sharing, secure mailflow, mailbox moves, as well as online archive.
- Address Book Policies Allows organizations to segment their address books into smaller scoped subsets of users providing a more refined user experience than the previous manual configuration approach. We also blogged about this new feature recently in GAL Segmentation, Exchange Server 2010 and Address Book Policies.
- Customer Requested Fixes All fixes contained within update rollups released prior to Service Pack 2 will also be contained within SP2. Details of our regular Exchange 2010 release rhythm can be found in Exchange 2010 Servicing.