What is the Primary SMTP email address

Testing a software recently, however still can’t get it up and running properly.  I have been dealing with the support guys but not having much luck, and they keeps on complaining about our Exchange.  He wants me to generate a list of the primary smtp email address for each mailbox user, so I find this post from on Google – http://unlockpowershell.wordpress.com/2010/01/27/powershell-get-mailbox-display-smtp-addresses/.

Thanks Xaegr and Karl’s scriptblock!!  This is only applicable to Exchange 2007 and 2010 powershell.

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv <csv file> –NoTypeInformation

With the above powershell script, you will be able to extract all Mailbox name, primary server, primary smtp and if any secondary smtp addresses.  Especially with the “Export” at the end to output it into a CSV file, I can read properly with Excel, but don’t forget to change the file name and path before running this script.



New gigabit switch not gigabit???

You see, as an IT person, we do learn new things every day.

We recently replaced some old 100Mbps switches to 1000Mbps smart switches, guess what!  it runs slower than before.  We didn’t realize that initially, and then the users can felt a little slower but still acceptable, or sometime it become very slow, but it comes back after a while.  We reported as a fault to the network management company, they reckon both gigabit switches are faulty, they can only ping at 510 bytes but not the normal 1500 bytes to the end device.

I don’t even know you can ping at different rate, so I found out this comment

ping -l [size in bytes] ip

Ping -l 2000 will ping the IP with 2000 bytes

Type ping /? for more options

(note: l = a small L)

if you have a slower network with good equipment, may be you should give this a try.

Outgoing SMTP on the go

I have been working with outlook for quite sometime now (well over 10 years actually), I only found out this solution to fix our mobile user problem today.   What they want to do is send/receive email on their laptop while they are on the road, it is now very easy with their USB wifi dongle.  however they can’t send email, the outgoing server didn’t authenticate properly.

I tried with the setting “POP before SMTP”  but very interesting, it still doesn’t want to work.  I ended up finding a simple answer, change the SMTP port from 25 to 587.  Apparently some ISP doesn’t let you route with their port 25, so we can only use port 587, which this port doesn’t have the encryption.  Most importantly it fixed the problem and works for the users.

Shrinking file in MSSQL 2008

If you have worked with previous version of SQL server, you know there is always an issue – the log file growing very fast and big.  If you have plenty of storage, then this might not be a problem for you.  Anyway, this has no exception in the latest version of SQL, we still have to do something to truncate and shrink these files, however they have changed the script command a little bit, so I would like to share with everyone as usual.

Here is the link to the official Technet page http://technet.microsoft.com/en-us/library/ms189493.aspx, it gives good examples and explanations.

For example if we need to shrink the size of log file to 100MB, the code will look like

USE databaseName;
-- Truncate the log by changing the database recovery model to SIMPLE.
-- Shrink the truncated log file to 100 MB.
DBCC SHRINKFILE (database_Logfile, 100);
-- Reset the database recovery model.


Run this script in the query screen, you will notice the file size changes in seconds.


“Ping” Command doesn’t work

Quite often that some of the command doesn’t work in the command prompt, showing some errors like

‘ping’ is not recognized as an internal or external command
‘defrag’ is not recognized as an internal or external command
‘ipconfig’ is not recognized as an internal or external command

but every time I forget about the fix, so let me put it here this time.

For Windows XP:

Right click “My Computer” and click “Properties”. Click the “Advanced” tab up top followed by the “Environment Variables” button at the bottom. In the 2nd list box, scroll down to the 5th or 6th entry “Path”, select it and click “Edit”. Add “%SystemRoot%system32;%SystemRoot%;” (minus the quotes) to the beginning of the line. Okay the changes and try out your commands now.

Cannot open outlook attachment

Today a user reported that she can’t open up an attachment in one of the email, then I went to try a few different things – one typical approach  “REBOOT COMPUTER”.  No!  not this time, it’s still can’t open.  The user is actually saying this is not the first time, the previous times were able to fix by close and open up Outlook, but this time don’t work.

Went on Google search, I found the problem very interesting.  It’s saying about permission problem with the “Temporary Internet Files” folder, and it’s suggesting to do a registry hack.  But this folder is not on network, it’s on local C drive, and this user is in a local administrators group.  Anyway, it doesn’t work!  So before I want to do this hacking, let me go to clean up the “Temporary Internet Files” folder under Internet Options.  Again, it still doesn’t work.

Then I followed the instruction from M$ Support http://support.microsoft.com/kb/305982, rebooted the computer, problem solved.

As you would imagine that local administrators group has full permission, how can it lose its permission to this folder?  To me, it’s a mystery~~

Recover single mailbox/file/folder from Exchange 2007

I have been backing up Exchange store many years, but to be honest, I have never ever used it to restore any mailbox or data.  The time finally comes, one of the director has a missing folder in his Exchange mailbox, we looked everywhere but still can’t find it, thus I have no other option but to do a recovery.

Surprisingly, it is not too difficult with the new Exchange console.  I found this article from Petri by Daniel Petri, he did a brilliant job of demonstrating steps.  I want to share with everyone.  By using this method, not only can restore the mailbox, it can also restore specific folder or even specific file or subject line, it’s a very useful and powerful tool.


Just 2 little things I would like to add, you need to make sure that the user mailbox has enough storage to merge/copy the backup, temporary increase it if necessary, and also make sure that you follow the exact steps, don’t skip steps because you are too smart 😛