Archive for Exchange

I am always forgetting the syntax for the New-ExchangeCertificate cmdlet when I need to do a new certificate request so I decided to write a little bit of javascript to build up the command automatically. Its much easier to copy and paste it from here than work with in it the Exchange 2007 Command Shell.

So just fill in the fields below and the command will be built automatically in the box below. Then just copy into command shell. If required, seperate the “Subject Alternative Names” with commas.

Common Name:

Subject Alternative Names:
Organisation:
Organisational Unit:
Town/City:
County/State:
Country:

CSR Command:

I am thinking of duplicating this code and writing another post which will generate the commands for the import of the newly generated certificate.

Comments (1)

Just been trying to install Exchange 2007 SP1 on a freshly installed Windows 2008 R2 and come up against the following error during the installation of the Mailbox Role:

Mailbox Role
Failed

Error:
An error occurred. The error code was 3221684229. The message was Access is denied..

Simple fix for this is to run setup.exe in compatibilty mode. I chose Vista SP2 and then the installation went through normally.

But before you go rushing to finish your installation it is worth noting that Exchange 2007 SP2 will not be supported on Windows 2008 R2, and therefore you may want to reconsider doing the installation at all! Read here:

http://msexchangeteam.com/archive/2009/09/21/452567.aspx

I flattened the installation and went back to Windows 2008 Standard.

Update: Microsoft have changed the policy to support Exchange 2007 on Windows 2008 r2:

http://msexchangeteam.com/archive/2009/11/04/453026.aspx

Categories : Technical Posts
Comments (0)

I have had several incidents this week of customer systems being infected by executables attached to e-mails appearing to be from UPS.

Looking around the blogs, these e-mails seem to be having a higher than normal infection rate. It is time consuming to get rid of and makes the infected machines unusable and creates a huge number of network connections.

The exact subject line of the email’s that have been received is:

UPS Tracking Number 5440074870

Attached to the e-mail is a zip file containing an executable which when executed installs "XP Security Center".

XPSecurity1 

Much more information about the detail of the actual email can be found on the Trend Malware Blog.  The worrying thing about this e-mail is that both of the machines that it infected have their e-mail filtered by very well known external 3rd party mail systems, then have virus scanning on their own Exchange servers and finally on their desktop machines.  At the moment this e-mail is still slipping through the net.

This virus does a LOT of clever things to prevent you getting rid of it.  I noticed that when trying to run Autoruns from Sysinternals that it just would not work.  Renaming the autoruns executable allows it to run.  It also stops you being able to install/download Windows Defender, disables system restore, removes the system tools program group amongst other things.

Not a very sophisticated solution but for now I have edited the Exchange IMF custom weighting file on customer systems to ensure that messages with "UPS Tracking" in the subject line are never delivered to the recipients and definitely classed as spam. 

I had written a separate post on how to remove the virus manually, but at the moment I am still monitoring the infected machines to ensure they are completely clean.

Categories : Technical Posts
Comments (1)
Oct
15

Sending backup tape reminder e-mails

Posted by: Paulie | Comments (3)

This is just a very quick script written in response to a question posted in one of the SBS yahoo groups.

It sends an e-mail to a specified recipient reminding them to change the backup tape in a server. The SBS backup system does this automatically, so this is meant for use on SBS servers using something other than the in-built SBS backup.

Installation is simply a case of extracting the contents of this zip file to a folder on your SBS server and then changing the variables at the top of the script to appropriate values for your environment.

Once done you can test interactively from a command line by running “cscript tapereminder.vbs” and once you are happy with the results setup a scheduled task to do the job daily.

Comments (3)

The ISMTPOnArrival_OnArrival event sink in Exchange 2003 can be used to trigger code to perform various tasks. I have recently used this method to strip attachments from messages and then FTP them to a remote machine, based on the message subject and recipient.

In this, more basic example the entire message is saved to the filesystem in .eml format to a folder specified within a variable. The script could be made much more elaborate with the addition of a couple of arrays to specify multiple subjects/locations. The idea is that you could setup a system where e-mails can be automatically filed without having to depend on user intevention and avoiding the requirement for 3rd party software.

This can be implemented by following the example from this Microsoft Knowlegbase article. The file referred to in the article called SMTPREG.VBS can be found here on MSDN. Instead of the SMTPMsgCheck.vbs file referenced in the article create a file called SMTPSubjectCheck.vbs and insert the following code(you will also need to modify the registration batch file accordingly) :


<SCRIPT LANGUAGE="VBScript">
Sub IEventIsCacheable_IsCacheable()
	'To implement the interface, and return S_OK implicitly
End Sub

Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
	Dim Pos, SubjectToFind, SaveFolder, MsgStream

	SubjectToFind="Project1"
	SaveFolder="c:\\"

	Pos=InStr(1,Msg.Subject,SubjectToFind,1)

	if Pos <> 0 then
		set MSGStream= Msg.Getstream
		SaveFile=SaveFolder & Msg.Senton & "-" & msg.subject & ".eml"
		SaveFile=Replace(SaveFile, "/", "_")
		SaveFile=Replace(SaveFile, " ", "_")
		SaveFile=Replace(SaveFile, ":", "_",3)
		MsgStream.SaveToFile savefile,2
		MsgStream.Close
		Set MsgStream = Nothing
	End if
End Sub
</SCRIPT>

In this example the script is looking for a subject line that contains the text “project1″(not case sensitive) and saving it to the root of c:

I have attached a zip file to the blog post with all the required files in one zip file, just be cautious of using it if you already have event sinks registered(drop the files into c:\eventsink).
subjectcheck.zip

Comments (0)
Jan
28

Exchange 2003 SP2 IMF Keyword Manager

Posted by: Paulie | Comments (28)

Exchange 2003 sp2 comes with an updated intelligent message filter. One of the new features of the updated IMF is the ability to add a custom weighting file that gives administrators more control over incoming mail.

I have used this file a few times on customers systems, usually to allow certain automated e-mails through the IMF which were being incorrectly identified as spam.

The problem is that Microsoft have not included a GUI to edit the MSExchange.UceContentFilter.xml file. ?Ǭ�So it must be generated by hand, and while this isn’t difficult, it is not very convenient and it is easy to make a mistake.

I was looking for an excuse to have a play with Visual Basic 2005 and so I have made a little utility to make creating and managing the MSExchange.UceContentFilter.xml a little easier.

Screenshot 1

Becomes….

Generated XML File

The utility can be downloaded from here.(Requires .net 2.0).

If you need more information on how to implement the custom weighting feature then see:

Microsoft Exchange Server 2003 Service Pack 2 Release Notes

Microsoft Exchange Server Intelligent Message Filter v2 Operations Guide

Comments (28)