Archive for March, 2010

Recover SQL Server from ‘Suspect’ Status

Tuesday, March 30th, 2010

Last night, I had a power outage and a SQL Server went down. When I rebooted, the database was in ‘Suspect’ mode. After some quick googling I found a solution.


Date Diff in PHP

Monday, March 22nd, 2010

Thanks to Ryan Means, I have an easy way to find the difference between 2 dates/times in PHP.

MSDTC event 53258

Tuesday, March 9th, 2010

I work with virtual machines alot.

One thing that I have noticed is that a windows VM that has been copied, NewSided, and added to a domain, generates MSDTC Event 53258, ALOT.

EventID: 53258

MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC
will continue to function and will use the existing security settings. Error
Specifics: d:\srvrtm\com\complus\dtc\dtc\adme\uiname.cpp:9280, Pid: 1148
No Callstack,
CmdLine: C:\WINDOWS\system32\msdtc.exe

EventID: 53258

MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC
will continue to function and will use the existing security settings. Error
Specifics: %1


After lots of time googling, I found the solution:

1. Run the Component Services MMC snap-in: Start -> Administrative Tools ->
Component Services.

2. Open Console Root -> Component Services -> Computers.

3. Right-Click on My Computer (in the Component Services window) and click Properties.

4. Open the MSDTC tab and click OK.

5. Close the Component Services window.

6. From a Command Prompt type net stop msdtc && net start msdtc.

Now you won’t get the MSDTC errors in the event log.

I believe that this process resets the computer name that MSDTC tries to connect to. In my case it was trying to connect to the computer named “base-vm”, but that computer no longer exists.

Telnet to test SMTP

Sunday, March 7th, 2010

Since I wrote up testing pop3 with telnet, I thought I would also wirte how to test SMTP with telnet.

From a command line in windows:

telnet

open IPofSmtpServer 25

220 mail.server.domain Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at . . . .

ehlo test.com

(test.com is the FROM domain)

250 OK

mail from:me@myDomain.com

250 2.1.0 me@myDomain.com. . . .Sender OK

rcpt to:you@yourDomain.com

250 OK – you@yourDomain.com

DATA

354 Start mail input; end with <CRLF>.<CRLF>

Subject: The Subject of the message.

Press enter TWICE.

The body of the message goes here.

Press enter.

Enter a single period (.) and press enter once more.

250 2.6.0 <………………….> Queued mail for delivery

Quit

221 2.0.0 mail.yourDomain.com Service closing transmission channel


Lots more SMTP info.