FamousPhil.com -- Home My Calendar Youtube LinkedIn Facebook MySpace Twitter RSS Blog Feed

Blog Navigation

Blog Home



Partners

Latest Activity

Another way to stop the unwanted calls even when you’re on the Do Not Call list

Phil explains how to use the old telephone tones to wane off telemarketers!



Posted on: November 21st, 2011 by Famous Phil

Most of the Matthouse infrastructure is running on old Celeron processors and limited RAM, you may laugh at me, but that hardware has been very reliable and has lasted Matthouse for the better part of 3 years, and some of it may continue to power Matthouse well into the future!  But there are some applications out there that require a little more juice to run well, and (unfortunately) Exchange falls into this category.  I say it is unfortunate since the Exchange server hosts a handful (< 10) mailboxes, yet it costs quite a bit to maintain compared to other Mail Transfer Agents (MTA).  So anyways, this blog is dedicated to the procedure that I took to migrate Exchange over to brand new, shiny, fast hardware.

First, I had Server 2008 R2 Datacenter as my operating system on both the existing server (denoted double) and the new server (denoted ruby).  The servers could clearly communicate with each other within the same datacenter as well so that file / data transfers could be effective.  The first thing to adding any server is to give the new server a name and know its network configuration details ahead of time.  I’m not going to go into details about how to install Windows, since it’s pretty simple.  Just make sure that you have the correct drivers installed for your server after the installation completes.

Note about installing Windows: just so that you don’t run into any issues with your system, make sure that your primary hard drive is attached to the first port for your motherboard’s interface, in my case, the first hard drive was connected to SATA 0.  If you don’t do this, you’ll run into a lot of problems and waste a lot of time (like I did!).  In addition, make sure that your BIOS has AHCI enabled prior to installing Windows, this also caused problems in my scenario.  Once Windows is installed, make sure that you can disable write caching on your hard disk without the operating system freezing (in computer management, under storage, right click the disk and optimize for quick removal).  If you followed the above, this shouldn’t cause Windows to hang, and will prevent Active Directory from incapacitating your system during the restart phase of the installation.  In addition, this is a good time to name your computer, join it to some default workgroup, add remote administration features, and change the time zone / clock settings.

Before continuing, I’d also recommend disabling Internet Explorer’s advanced security features; this is done by going to the computer management main screen and scrolling down, finding IE ESC and turning it off (acknowledging all of the warnings).  If you keep them on, you’ll find yourself doing way too much work to download necessary applications, etc.  These features are only useful if you plan on doing general web surfing on the server (which I would not recommend for security reasons).  I also activated windows, ran all the necessary windows updates (several reboots and optional updates as well).  After this all has been done, I ended up rebooting the machine a final time.

At this point, I installed several applications (using IE to get Google Chrome initially).

Tags: , , , , , , ,
Posted in Hosting / Server Administration, Technology
|| No Comments »

Posted on: July 3rd, 2011 by Famous Phil

Over the past couple of months, I’ve found that the script that I posted at http://famousphil.com/blog/2011/01/a-decent-backup-strategy-for-exchange-2010-sp1/ hasn’t been working perfectly for my needs.  This relatively short blog is kind of a back track blog to explain the issues and provide some fixes for them.

The original script I posted does not verify that the backups actually completed.  The emails I got were simply gibberish.  I was willing to accept that for a while until during monthly maintenance when I manually verify backups, I was finding that backups didn’t always complete.  I’ve tracked this down in the error logs and found that the memory in the server isn’t enough for the backups at times which has them fail at certain times.  Due to the lack of user base on my server (4 light users), I can’t justify adding more ram (I currently have 4GB) because I’d have to upgrade the entire server.  So instead, I did some RAM optimization and re-wrote the backup script to email me the actual backup names that completed successfully.

First for the tips.  I recently learned that Active Directory can be modified from the backend, so using this, I modified the Information Store service (store.exe) in Exchange to only use at most 512MB of ram.  I used the information at http://terrytlslau.blogspot.com/2011/03/limiting-exchange-server-2007-and-2010.html for doing this, I briefly repeat the procedure here in the even that this link is no longer reachable.

1. At Domain Controller, login as a Domain Administrator.
2. Click "Start", enter "adsiedit.msc" into the search box, hit enter.
3. Right-click "ADSI Edit", select "Connect to".
4. Enable the Naming Context view, click ok to connect
4. Under the "Naming Context" menu, select "Configuration".
6. Expand to "Configuration > Services > Microsoft Exchange >  > Administrative Groups > Exchnage Administrative Group > Servers >  > InformationStore".
7. Right-click "InformationStore", select "Properties".
8. Select "msExchESEParamCacheSizeMax".
9. This value is set in pages, in Exchange 2010 the size is 32KB/page; Exchange 2007 is 8KB/page.  Simply figure out the number of pages for the amount of ram you want to limit store.exe to using.

For instance, if you want to limit the Database Cache to 4 GB of an Exchange 2010 server, set msExchESEParamCacheSizeMax to 131072 (4 GB = 4.194.304 KB / 32 KB). If you want to limit the Database Cache to 2 GB of an Exchange 2007 server, set msExchESEParamCacheSizeMax to 262144 (2 GB = 2.097.152 KB / 8KB).
10. Ok everything and restart the Information Store service (possibly the server)

After limiting the Exchange Information Store service, I simply restarted the Information Store service and that seems to have fixed the gouging memory issue.

As a second optimization procedure, I started tackling the IIS Worker Processes.  Exchange has several application pools that it uses, you can think of an application pool in IIS as a separate instance of Tomcat or Apache for each website.  Application Pools isolate websites to that they can’t affect each other.  On the downside, application pools also hog a great amount of memory and for the features of Exchange that you may not use often (e.g. powershell, calendar, exchange control panel), it takes some time for these features to load initially (for me, its about 30 seconds).  My solution was to limit Exchange to two application pools.  For anything service related, I used the Exchange Service Pool (e.g. EWS, Powershell, Autodiscover), and anything client site based (e.g. OWA, Calendar, ECP, ActiveSync) in the OWA pool.  I still do not know if any update to Exchange may reverse this or break this, but I do keep it in mind during updates.  The result of doing this is that not only is memory consumption reduced significantly, but Outlook Web Access, Exchange’s Calendar display (for the public), and Exchange Control Panel all load much faster now since the overhead in IIS is already loaded.  Of course, I wouldn’t recommend doing this unless you can’t easily upgrade the amount of memory in your server.

Finally, I will leave you with an improved export script that replaces the script in my previous blog at http://famousphil.com/blog/2011/01/a-decent-backup-strategy-for-exchange-2010-sp1/.  This script verifies that all of the users were actually uploaded and emails the complete report to you (instead of some garble).  I’ve found it to be very helpful in determining if a mailbox was failing to export to a PST without having to login to the file server and check.  As always, use this script at your own risk, I am willing to provide limited support as time permits.

# Exchange 2010 SP1 Mailbox Export Script
# Originally from Steve Goodman.
# Modified by Philip Matuskiewicz for Matthouse.us / famousphil.com 1/2/11 FIXED *7/2/11*

#define information here
$server = "host.example.com" #server hostname
$users = @("Joe", "Mary", "Phil") #users to archive
$destination = "localhostpstbackups" #network share to backup to
$emailfrom = "server@yourdomain.com"
$emailto = "you@yourdomain.com"
#define some internal variables
$output = ""
$error = 0
$date = Get-Date

#check for errors
if (!(Get-ExchangeServer $server -ErrorAction SilentlyContinue)){
    $output += "Exchange Server $server not found`n";
	$error = 1
}
if (!(Get-MailboxDatabase -Server $server -ErrorAction SilentlyContinue)){
    $output += "Exchange Server $server does not have mailbox databases";
	$error = 1
}

#create a batch job if the above tests succeeded
if ($error -ne 1){

	$jobname = "Export_$($date.Year)-$($date.Month)-$($date.Day)_$($date.Hour)-$($date.Minute)-$($date.Second)"
	$output += "Job title is: '$($jobname)' `n"
	Write-Output "Job title is: '$($jobname)' "

	foreach ($mailbox in $users){
		#remove existing PST file
		if (Get-Item "$($destination)$($mailbox).PST" -ErrorAction SilentlyContinue){
			Remove-Item "$($destination)$($mailbox).PST" -Confirm:$false
			$output += "Existing PST was deleted (Normal): '$($mailbox)' `n"
			Write-Output "Existing PST was deleted (Normal): '$($mailbox)' "
		} # end if

		#request a backup of the mailbox, Exclude the recoverable items / deleted items
		$mailboxjobname = "$($mailbox)-$($jobname)"
		New-MailboxExportRequest -BatchName $jobname -Mailbox $($mailbox) -FilePath "$($destination)$($mailbox).PST" -ExcludeDumpster -Name $mailboxjobname
		$output += "Mailbox Queued: '$($mailbox)' `n"
		Write-Output "Mailbox Queued: '$($mailbox)' "

	} #end foreach
} #end $error -ne 1

#wait for the jobs to complete
$time = 0;
while ((Get-MailboxExportRequest -BatchName $jobname | Where {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"})){
	Write-Output "Waiting on backup, it has been $($time) seconds"
	$output += "Waiting on backup, it has been $($time) seconds `n"
	sleep 600 #10 minutes
	$time = $time + 720;
} #end while

#check for any jobs that didn't complete
$incomplete = Get-MailboxExportRequest -BatchName $jobname | Where {$_.Status -ne "Completed"} | Get-MailboxExportRequestStatistics | Format-List
$complete = Get-MailboxExportRequest -BatchName $jobname | Where {$_.Status -eq "Completed"} | Get-MailboxExportRequestStatistics | Format-List

if($incomplete){
	Write-Output "ERROR: Something didn't complete, output is '$($incomplete)'"
	$output += "ERROR: Something didn't complete, output is '$($incomplete)' `n"
}

if($complete){
	Write-Output "Completed Successfully, output is '$($complete)'"
	$output += "Completed Successfully, output is '$($complete)' `n"
}

# Remove Requests and clean up
Write-Output "Cleaning up requests that were part of the job '$($jobname)'"
$output += "Cleaning up requests that were part of the job '$($jobname)' `n"
Get-MailboxExportRequest -BatchName $jobname | Remove-MailboxExportRequest -Confirm:$false

#verify that all the PST files were created...
foreach ($mailbox in $users){
		#remove existing PST file
		if (Get-Item "$($destination)$($mailbox).PST" -ErrorAction SilentlyContinue){
			$output += "PST FOUND!!!: '$($mailbox)' `n"
			Write-Output "PST FOUND!!!: '$($mailbox)' "
		}else{
			$output += "ERROR: PST NOT FOUND: '$($mailbox)' `n"
			Write-Output "ERROR: PST NOT FOUND: '$($mailbox)' "
		}
}

$SmtpClient = new-object system.net.mail.smtpClient("double.matthouse.org")
$msg = new-object Net.Mail.MailMessage
$msg.From = "$($emailfrom)"
$msg.To.Add("$($emailto)")
$msg.Subject = "EXCHANGE EMAIL BACKUP DETAILS"
$msg.Body = $output
$SmtpClient.Send($msg)

Write-Output "Script complete!"

Tags: , , , ,
Posted in Hosting / Server Administration, Technology
|| 4 Comments »

Posted on: January 11th, 2011 by Famous Phil

There is a new blog with additional information on this topic at http://famousphil.com/blog/2011/07/revisiting-exchange-2010-sp1-pst-backups-improved-script/

About a week ago, I finally got around to reviewing and upgrading my existing backup routine for my exchange server.  My previous backup scheme involved pushing a full server backup image to a remote server on a weekly basis.  If the server failed during a backup, I would have no viable way of recovering from a complete disaster.  Obviously, this required some changes.

With the release of SP1 for Exchange 2010, a few new power shell commandlets came out that provide functionality to back up Exchange accounts directly on the server (no needing second computer with outlook and exchange management tools anymore!).  This meant that I decided to utilize some backup scripts that backup each mailbox nightly.  I also modified the weekly system backup.

There are scripts attached to this post.  With any kind of solution that I provide, I always provide it on an as is basis with no warranty provided that it will work for your situation, although I try my best to cover as many scenarios as I can.

So what was decided upon? Read the rest of this entry »

Tags: , , , , , ,
Posted in Hosting / Server Administration
|| 3 Comments »

Posted on: August 18th, 2010 by Famous Phil

Reminders: As with anything I post, I ask that you provide a backlink to my code if you use it (if you don’t, its considered plagiarism).  Also, the code below is the outcome of 2 days in ASP.net as an excursion, I’m sure that my code could be improved vastly.  I’m also not going to baby step through this, so you’re going to have to be a somewhat experienced programmer to follow along with the rest of my blog.  One last thing: If you feel the urge to donate to me for my time (provided this solution helped you), please use the NEW donate button in the footer, I appreciate it. Read the rest of this entry »

Tags: , , , , , , , , , ,
Posted in My Site, Programming
|| 29 Comments »

Posted on: August 17th, 2010 by Famous Phil

For a long time now (2 years and counting), I’ve been wanting to dabble with ASP and Microsoft web technologies.  It seems that for every project that I want to dabble with, I have to gather a lot of ambition and have an end goal in mind well before I begin.  I guess that being a seasoned programmer; I have gotten very lazy at what projects I feel like attacking (this is partially why this blog doesn’t get a post every day).

Read the rest of this entry »

Tags: , , , , ,
Posted in Programming
|| 9 Comments »

Posted on: October 8th, 2009 by Famous Phil

As of yesterday, Microsoft’s Exchange 2010 team announced the release of the Exchange 2010′s RTM here: http://msexchangeteam.com/archive/2009/10/08/452775.aspx#comments.  This is exciting news because I can finally request the RTM and begin migrating my systems to the new Exchange. I have been waiting a few months now for this release because it will be the start of many changes to my web hosting services as well that I need to take further steps to secure and improve performance on.

For those of you who don’t know what an RTM is, this is the Release to Manufacturing version that usually becomes the full version within a few months automatically.  Unlike Release Candidates, the RTM version of any software packages will become the full version meaning they don’t require any re-installation or pose any security threats to use in production.

Exchange 2010 is important for me because it will introduce the send as function like hotmail and other providers have.  I have many email addresses, but my University at Buffalo address is my most important, so I send as my @ Buffalo address.  With 2010, this will no longer be the case because I will reply to email as the address it was sent to.  I believe this will prevent a lot of confusion to contacts that don’t recognize my university address.

With Exchange 2010, I will also be upgrading the hardware that hosts my email infrastructure.  I will be supporting Server 2008 R2 which is the latest operating system for Windows Server.  I believe this was only fully released a few days ago and it is very similar to Windows 7.  For those of you who don’t keep up with new releases of Windows, Windows 7 will be released to everyone late this month.  I am currently using the RTM version of Windows 7 and I find that it is about 10x faster and more stable than Windows XP.  Compared to Windows Vista, I’d say its about 50x more stable, faster, and more efficient.  Since Server 2008 is Vista’s server operating system, I prefer to stay away from Server 2008 entirely.

For those of you who are thinking about upgrading to Windows 7, I’d strongly recommend it!  First, if you are running Windows Vista, you’d be nuts not to goto Windows 7 within a few months of its final release.  Windows 7 is practically the same but much more efficient.  You will find that everything will be much easier to use on Windows 7 than Windows Vista.  For those of you on Windows XP, it might be time to bite the bullet and upgrade (like I did).  For the most part, if your system runs Windows XP fine, it will not have any issues running Windows 7 fine.  I did find a few minor problems with XP applications (mostly MIDI musical instrument related) not working on Windows 7, but support is fairly good otherwise.  Just one word of caution to the developers out there, if you want to run Visual Studio 2005/2008 on Windows 7, don’t install any Microsoft Office 2007 compatibility pack or PDF package.  These will make Visual Studio’s Installation fail (on my preliminary tests).

Now to get into some security updates.  I plan on migrating all of my systems to a more secure environment shortly after Exchange 2010 is fully implemented.  I will have 1 gateway server that serves as a connection point for all services within Matthouse to keep everything tightened down.  Within the next few months you can expect performance increases on sites that I host including my own (this one).

I have a lot more to blog about, and I hope to get around to it all as time permits.  My next blog will hopefully be something about mail filtering.

Tags: , , , , , ,
Posted in Hosting / Server Administration, Technology
|| No Comments »