Archive for June, 2007


I have been receiving this error on my SBS 2003 R2 server (with SP1):

Error category : Resource Errors
Error : e000fedf - A failure occurred reading an object.
For additional information regarding this error refer to link V-79-57344-65247

If you follow the link it will redirect you to Symantec’s site. Instructions found there will direct you to enable debug logging on some of the services.

The information found there will give you an example, showing the the file sfcfiles.dll as being corrupt. I followed the instructions and coincidentally found the exact same file to be corrupt on my server as per the log files generated during a backup of the system state.

I compared the version of the file on my server with another healthy server and found that the MD5 hash of the two files differed. I copied the healthy file onto my server and ran another backup of the system state, but the problem persisted.

Symantec forums directed me to re-install Windows Server – SP1 which solved the problem.



So you’re all excited… you just installed Outlook 2007 and you think it’s great… until your friends start forwarding you all those funny e-mails we all love to receive, but you can’t see the animation in animated GIF images.

This is not a bug in Outlook 2007, but rather a feature (that I am sure most will find rather frustrating).

As per Microsoft:

Other Unsupported Web-Related Features
The following is a list of all other Web-related features that Word 2007 does not support:

  • Animated GIF images. Only a static representation of the GIF image shows.
  • Flash. Only a red “X” shows in the area where the flash would display.

For full details please see:
http://msdn2.microsoft.com/en-us/library/aa338201.aspx

Currently there is no known quick solution for this, but one workaround is to save the e-mail message somewhere on your hard drive and then open it using your favourite browser.

Here’s how you do it:

  • Select the message, don’t open it
  • Click file, save
  • It should be in htm / html format by default
  • Browse to a folder where you can open the mail from (I always use my desktop)
  • Double click the file on the desktop and voila your message displays in your default browser (typically Internet Explorer) and you can see all the animations.
  • Once your done reading (and hopefully laughing), close Internet Explorer
  • Rember to delete the file and folder created by saving the message – you don’t want to waste disc space or clutter your desktop

SMTP Problem solving

posted by Sam Ravenscroft
Jun 2

About 2 weeks ago I was assisting a friend of mine to upgrade her server hardware. They had also moved to a new ISP for hosting et al.

We had some problems with the outgoing mail queues in Exchange 2003. Exchange was setup to deliver mail directly (via DNS). Not all of the mail could be delivered.

The tools used to debug these kind of problems are nslookup and telnet. (There are many other tools available, but these 2 tools can be used on any out-of-the-box Windows / Server installation.)

Let’s say for example that you cannot send mail to user@microsoft.com…

Open up a command prompt (start, run, cmd)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>nslookup
Default Server: UnKnown
Address: 192.*.*.*

> set type=mx
> microsoft.com
Server: UnKnown
Address: 192.*.*.*

Non-authoritative answer:
microsoft.com MX preference = 10, mail exchanger = maila.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailb.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailc.microsoft.com

microsoft.com nameserver = ns5.msft.net
microsoft.com nameserver = ns1.msft.net
microsoft.com nameserver = ns2.msft.net
microsoft.com nameserver = ns3.msft.net
microsoft.com nameserver = ns4.msft.net
maila.microsoft.com internet address = 205.248.106.64
maila.microsoft.com internet address = 131.107.115.212
mailb.microsoft.com internet address = 131.107.115.215
mailb.microsoft.com internet address = 205.248.106.30
mailc.microsoft.com internet address = 131.107.115.214
mailc.microsoft.com internet address = 205.248.106.32
ns1.msft.net internet address = 207.68.160.190
ns2.msft.net internet address = 65.54.240.126
ns3.msft.net internet address = 213.199.161.77
ns4.msft.net internet address = 207.46.66.126
ns5.msft.net internet address = 65.55.238.126
> exit

C:\>

Here’s the breakdown:

nslookup // this is a command line tool to perform DNS lookups
set type = mx // this tells nslookup that we are interested in MX record (Mail eXchanger)
microsoft.com // this is the domain for which we want to do the lookup
exit // self explanatory

The results we are interested in are:

Non-authoritative answer:
microsoft.com MX preference = 10, mail exchanger = maila.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailb.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailc.microsoft.com

Basically this means that the domain Microsoft.com has 3 mail servers (or mail exchangers) and that each server has a preference of 10 (lower preference means more preferred, i.e. your backup MX server should have a higher preference that your primary MX server). When the MX records for a domain have the same preference it is used for load balancing as neither is more preferred than the other.

Ok, let’s proceed to telnet. From the list above we will use maila.microsoft.com as it is the first in the list (in a different scenario you would choose the primary MX server, i.e. the one of the lowest preference).

(once again from a command prompt)

C:\>telnet maila.microsoft.com 25

220 mail04.microsoft.com Microsoft ESMTP MAIL Service ready at Sat, 2 Jun 2007 1
0:24:12 -0700
ehlo localhost.localdomain
250-mail04.microsoft.com Hello [41.*.*.*]
250-SIZE 10485760
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH
250-8BITMIME
250-BINARYMIME
250 CHUNKING
mail from: user@localdomain.com
250 2.1.0 Sender OK
rcpt to: bill@microsoft.com
550 5.7.1 Email rejected because 41.*.*.* is listed by zen.spamhaus.org. Please see http://www.spamhaus.org/query/bl?ip=41.*.*.* for more information.
quit
221 2.0.0 Service closing transmission channel

connection to host lost.

C:\>
(note: some of the IP's etc. above were masked in the interest of privacy)

Here’s the breakdown

telnet maila.microsoft.com 25 // connect to remote server on port 25 (SMTP)
ehlo localhost.localdomain // ehlo command
mail from: user@localdomain.com // who the mail is from
rcpt to: bill@microsoft.com // who the mail is for
quit // close the connection

The response:

550 5.7.1 Email rejected because 41.*.*.* is listed by zen.spamhaus.org. Please see http://www.spamhaus.org/query/bl?ip=41.*.*.* for more information

And that is how it’s done. Obviously the response code will differ according to what the problem is.

Under normal circumstances one would simply use nslookup and telnet to debug the problem, but I found this great tool called bmail from Beyond Logic it can be downloaded from http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

Bmail is a command line mailer, you will still need to obtain the MX record using nslookup, but thereafter it is much easier to use bmail.

Example:

(from the command line)

C:\>bmail

Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Date: Sat, 02 Jun 2007 21:00:47 +0200
Usage: bmail [options]
-s SMTP Server Name
-p SMTP Port Number (optional, defaults to 25)
-t To: Address
-f From: Address
-b Text Body of Message (optional)
-h Generate Headers
-a Subject (optional)
-m Filename (optional) Use file as Body of Message
-c Prefix above file with CR/LF to separate body from header
-d Debug (Show all mail server communications)

C:\>bmail -s maila.microsoft.com -t bill@microsoft.com -f user@localdomain.com -h -a "Test message" -d

Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Opening connection to maila.microsoft.com [205.248.106.64] on port 25
220 mail04.microsoft.com Microsoft ESMTP MAIL Service ready at Sat, 2 Jun 2007 1
2:42:11 -0700
HELO localhost
250 mail04.microsoft.com Hello [41.*.*.*]
MAIL FROM:<user@localdomain.com>
250 2.1.0 Sender OK
RCPT TO:<bill@microsoft.com>
550 5.7.1 Email rejected because 41.*.*.* is listed by zen.spamhaus.org. Please see http://www.spamhaus.org/query/bl?ip=41.*.*.* for more information.
550 5.7.1 Email rejected because 41.*.*.* is listed by zen.spamhaus.org. Please see http://www.spamhaus.org/query/bl?ip=41.*.*.* for more information.

C:\>

The -d (debug switch) is obviously very important here as it shows you the full SMTP conversation.


Scheduled Disk Defrag

posted by Sam Ravenscroft
Jun 2

Credit goes out to Doug Knox for this one.

Microsoft Windows offers a built in tool for defragmenting your hard drives. Sometimes it can be hard to defragment many hard drives on remote machines regularly without the help of 3rd party tools. The following is a visual basic script which will allow for this.

Copy and paste the following text into notepad and save it as a .vbs file.

defrag_all2.vbs
 
'Defrags all hard disks - Can be run as a Scheduled Task
'Modified to create an error log and display it
'© Doug Knox - 4/13/2002Option Explicit
 
Dim WshShell, fso, d, dc, ErrStr(), Return, X, A(), MyFile, I, MyBox, Drive
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
X = 0
Set dc = fso.Drives
For Each d in DC
If d.DriveType = 2 Then
X = X + 1
 
'Determine drive letter of first fixed disk
'This is the drive that the error report will be placed on
If X = 1 Then
Drive = d
End If
End If
Next
ReDim A(X)
ReDim ErrStr(X)
X = 0
For Each d in dc
If d.DriveType = 2 Then
X = X + 1
Return = WshShell.Run("defrag " &amp; d &amp; " -f", 1, TRUE)
 
'Determine the Error code returned by Defrag for the current drive and save it
If return = 0 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag completed successfully" &amp; vbCRLF
elseif return = 1 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (defrag was cancelled manually) " &amp; vbCRLF
elseif return = 2 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (there was a command line error. Check your command line for valid switches and drives)" &amp; vbCRLF
elseif return = 3 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (there was an unknown error)" &amp; vbCRLF
elseif return = 4 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (defrag could not run due to insufficient memory resources)" &amp; vbCRLF
 
'errorlevel 5 is not currently used
elseif return = 5 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (general error)" &amp; vbCRLF
elseif return = 6 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; "(System error: either the account used to run defrag is not an administrator, there is a problem loading the resource DLL, or a defrag engine could not be accessed. Check for proper user permissions and run Sfc.exe to validate system files)" &amp; vbCRLF
elseif return = 7 then
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with error level " &amp; return &amp; " (There is not enough free space on the drive. Defrag needs 15% free space to run on a volume)" &amp; vbCRLF
else
ErrStr(x) = ErrStr(x) &amp;  "Drive " &amp; d &amp; " Defrag aborted with an unknown error level: " &amp; return &amp; vbCRLF
end if
End If
Next
 
'Create the Error Report in the root of the first fixed disk.
Set MyFile = fso.OpenTextFile(Drive &amp; "defragreport.txt", 2, True)
MyFile.WriteLine(Date) &amp; vbCRLF
MyFile.WriteLine(Time) &amp; vbCRLF
For I = 1 to X
MyFile.WriteLine(ErrStr(I))
Next
MyFile.Close
'Return = WshShell.Run(Drive &amp; "defragreport.txt",3,True)
Set WshShell = Nothing
Set fso = Nothing

Run task scheduler and schedule the task how often you would like and let it run.

If a user is logged on, it will display the txt file when it is done. To disable this feature all you need to do is comment out the fourth line from the bottom

'Return = WshShell.Run(Drive & "\defragreport.txt",3,True)

Here’s the script, enjoy

This information is provided “AS IS” with no warranty expressed or implied.


Enable/disable Defrag at boot time

posted by Sam Ravenscroft
Jun 2

Open Regedit (Start/Run/Regedit)

Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction

Select Enable from the list on the right. Right on it and select Modify. Change the value to Y to enable and N to disable.

Reboot your computer.

(This function is enabled by default.)