How to clear the MS Exchange mail queue quickly

Spent the day dealing with an exchange server that had been compromised. As a result, heaps of spam emails were in the exchange mail queue. Manually removing them is a major pain in the rear. Fortunately, others have shared how to clear the Microsoft Exchange mail queue of thousands for spam mails.

  1. Stop the SMTP service.
  2. Create a new spam folder for example in
    C:\Program Files\Exchsrvr\Mailroot\vsi 1\Spam
  3. With the SMTP service still stopped, move all the messages from the
    C:\Program Files\Exchsrvr\Mailroot\vsi 1\Queue
    to the spam folder (in case you need to retrieve a message)
  4. Restart the SMTP service.

Of course prior to doing that, the instructions at this Microsoft KB How to block open SMTP relaying and clean up Exchange Server SMTP queues in Windows Small Business Server is quite helpful in showing how to make sure your exchange server is not an open relay. It also shows how to test if it is an authenticated relay attack that is the problem.

How to block open SMTP relaying and clean up Exchange Server SMTP queues in Windows Small Business Server

Using registry values in scripts

I’m often writing scripts to do stuff. It makes my job easier. I’ve often wanted to be able to script the discovery of registry values in the Windows Registry.

Thus here is a short example on using the vanilla windows command line to find the value of a Windows registry key. From my testing these commands are all present by default in Windows XP, Vista, 7, Server 2003 and Server 2008.

Assume we want to find the Microsoft Windows Common Files directory. Using `Regedit` we can find that here: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir`

So the first thing we want to do is query the registry, we do that with the command line tool `reg` as follows ([more about reg][]):

[more about reg]:http://www.petri.co.il/reg_command_in_windows_xp.htm
“Read up on how to use the reg command for more than just a query”

`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp`

This will spit out the following into the text file `1.tmp`:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
CommonFilesDir REG_SZ C:\Program Files\Common Files

However, this isn’t of much use in a script. Really, we just want the value of the folder itself, not all the extra info.

So what we do is use the command line tool ‘findstr’ which essentially is a windows regex tool ([more about findstr][]). We use it to do this:

[more about findstr]:http://www.netexpertise.eu/en/windows/findstr-an-alternative-to-grep.html
“Read up on findstr – regex goodness on windows by default”

`findstr /r REG_SZ 1.tmp >2.tmp`

This spits out just the line that contains REG_SZ and puts it into the text file `2.tmp`. Now that we’ve just just the one line, we want to strip the first 32 characters off it. We do this by first setting it as an enviroment variale and then trimming it down using the following two commands ([more on set][]):

[more on set]:http://www.computing.net/answers/windows-2000/use-file-contents-to-set-variables/63174.html
“Using file contents to set enviroment variables”

`set /p CommFiles=<2.tmp` And then we shorten that ([more on trimming][]): [more on trimming]:http://www.dostips.com/DtTipsStringManipulation.php "Read up on using set to trim environment variables" `set CommFiles=%CommFiles:~32%` Then we can echo the result to the screen using: `Echo The Common Files directory is: %CommFiles%` And here it is all in one easy to copy set: --- Set CommFiles=C:\Temp reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp
findstr /r REG_SZ 1.tmp >2.tmp
set /p CommFiles=<2.tmp set CommFiles=%CommFiles:~32% Echo The Common Files directory is: %CommFiles% --- With a little editing I'm sure that you can turn this to your own uses, pulling out the value of registry keys and using them in script files. You're not limited to this registry key, you can use it to access all sorts of registry keys. Please do tell me what uses you put this to. Enjoy.

Finding user SID

Occasionally you may want to know the [SID][] of a windows user. If that made no sense to you, read no futher, this snippet is not for you.

[SID]:http://encyclopedia.thefreedictionary.com/Security+Identifier
“Read a definition of what the SID is”

Open up REGEDIT and browse to this key:

`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList`

Here you will find a list of SID’s, under each is a subkey containing the name of the user it is associated with. Run through them until you find the username you’re looking for and bingo, it’s parent key is that users SID.

Found via [petri.co.il][]

[petri.co.il]:http://www.petri.co.il/forums/showthread.php?t=21332\
“petri.co.il is a wealth of tech goodness”

[Bonus link][]

[Bonus link]:https://secure.wikimedia.org/wikipedia/en/wiki/Security_Identifier
“More explaination of SID’s, decoding them etc”

Setting up WriteMonkey on WordPress

This post has been written using [WriteMonkey](http://writemonkey.com/ “Zenware for full screen distraction free writing”) as the text editor. Not only that but I’ve utilised Markdown as the method of text mark-up. All of this has been achieved using WordPress as my CMS, Firefox as my browser and a Firefox plug-in called It’s All Text.

My first impressions are actually good. Although its taken a little setup, I’m actually happy with the result. You see, using WriteMonkey as a text editor is, well, gorgeous. The screen is emptied of all distractions. With typewriter mode enabled, it is a pure joy to use.

Now to get this to work I did the following:

+ [disabled the visual editor](http://digwp.com/2010/06/blogging-in-markdown/ “Article by Chris Coyier on blogging in WordPress with Markdown”) in [WordPress](http://wordpress.org “The official WordPress site”),
+ installed the [It’s All Text](https://addons.mozilla.org/en-US/firefox/addon/4125/contribute/roadblock/?src=addondetail “Firefox add-on page for It’s All Text”) Firefox plug-in,
+ installed the [PHP Markdown](http://michelf.com/projects/php-markdown/ “Download page for PHP Markdown”) [plug-in for WordPress](http://wordpress.org/support/topic/160189 “Help getting Markdown working in WordPress”),
+ started writing :)

Not so hard is it? Actually the writing bit is the hardest. But you knew that…

What it now means is that when I begin writing a new post in WordPress, I simple click the little edit button that appears, and WriteMonkey fires up, comes to the foreground and I start writing. To finish up, I press CTRL-Q and I click YES I do want to save it.

So I can whole-heartedly say that it’s worth the effort to setup [WriteMonkey](http://writemonkey.com/ “Zenware for full screen distraction free writing”). Go do it! It feels good.

Of course, now the hard bit is about to start, that is, do more writing.

PS: Only found out about WriteMonkey via [DownloadSquad](http://www.downloadsquad.com/2010/07/23/writemonkey-0-9-9-0-final-version-released-full-screen-text-lov/ “These guys are on the bleeding edge of shiny”)

How to: Clear Outlook Location list

Had an issue yesterday where we wanted to remove some entires from Outlooks location list.

Huh? When you book an appointment in Microsoft Outlooks calendar you can specify a location. If ACT! by Sage has a Resource that is designated as a location, when ACT! sync’s with Outlook that location list gets filled in.

So, we wanted to edit that list in Outlook. Well, you can’t.

But you can clear the list completely, which for our purpose suited us fine, it’ll get repopulated with the correct values.

Thus, without further ado, here is how you do this:

Open up Regedit and remove the value from this key:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Preferences\LocationMRU

Note that you will need to replace the version number for your version of Microsoft Office (14.0 = MSO2010, 12.0 = MSO2007).

Hat tip to superuser.com.

How to: discover open files on Microsoft Server

So you’re working on a Microsoft Server machine, merrily getting stuff done, when you get a message saying that it can’t continue because files are open. Sound familiar? It happens to me often.

Here is how I find out which files are open and who has them open:

If you’re working on a Microsoft Server 2008,
Start | Administrative Tools | Share and Storage Management | Manage Open Files…

If you’re working on a Microsoft Server 2003,
Start | right click My Computer | Manage | Computer management (local) | System Tools | Shared Folders | Open Files

Makes it a great deal easier, now you know which file needs closing, and who you need ask to do it.

Hope that helps you. Anything you’ve found helpful? Let me know in the comments.

The Complete Guide to Google Wave: How to Use Google Wave

Google Wave is occuping a great deal of mind space at the moment, the best site I’ve found that explains what it is, and how to use it is this, which starts out with this:

The Complete Guide to Google Wave is a comprehensive user manual by Gina Trapani with Adam Pash.

Google Wave is a new web-based collaboration tool that’s notoriously difficult to understand. This guide will help.

read more here: The Complete Guide to Google Wave: How to Use Google Wave.

The jury is still out for me, but at this point Gina and Adams explanation has made more sense of it, how this helps CRM and how it can be integrated with ACT! is what I’m mostly interested in.

Why ACT! won’t print a report

Often I’ve been told “my ACT! won’t print reports, it doesn’t matter which report I select, it won’t print”.

In the majority of these cases, the fix is actually very quick and simple.

You simply require at least one printer installed and have it set to be the default printer.

See, that was simple. Unfortunately, people sometimes remove all their printers, or for some reason none of their printers are marked as being the default printer and the first sign of trouble is that when they go to print out a report in ACT! it doesn’t work.

Novice to Expert

After spotting a link to both the Dreyfus Model of Skill Acquisition and Pragmatic Thinking and Learning: Refactor Your Wetware, I’ve read the original 1980 paper by the Stuart and Hubert Dreyfus (A Five-Stage Model of the Mental Activities Involved in Directed Skill Acquisition)which made for interesting reading.

It describes (suprise!) 5 stages one goes through when learning a skill:

  • Novice
  • Advanced beginner
  • Competent
  • Proficient
  • Expert

I’ve yet to read the book Pragmatic Thinking and Learning: Refactor Your Wetware, but the two chapters that are online (“Introduction” and “Journey From Novice to Expert”) and the mind map shown all lead me to believe that the book uses the Dreyfus Model as a basis to then provide practical measures to implement in order to make your way from novice to expert.

This is of interest to me because since October 2008 I began working with a product called ACT! which is a Contact and Customer Relationship Management product. When I began I was a Novice at using and implementing ACT!. My employer provided great training which got me to the Advanced beginner stage. Constant use and troubleshooting got me to the Competent stage, which was validated by my passing the ACT! Certified Consultants Exam. Now I’m chipping away at the Proficient stage, made just a little more interesting by the fact the the software has just been updated to version 12 (ACT! by Sage 2010).

But enough about me, what have you been working on becoming an expert on?

Wildcard searching Lookups

I often find I want to find someone or a company in ACT!, however I can only remember part of their name – wildcard searching to the rescue.
If I do a company lookup for “outback“, I only get returned a list of companies that begin with “outback“.
However, if I do a company lookup for “%outback” – note the percent sign prefixing the search term, I get a list of all companies that contain the word “outback“.
This is quite useful and can be used on any of the fields, not just the company field.

Become a blogger

Yes – I signed up to Becomeablogger.com – after reading the free road map PDF and watching the 10 free Howto videos.

Even tho I’ve been blogging since 2002, in the last 24 hours I’ve already learnt stuff. Plus I’ve got access to a private forum (ie no trolls) where like minded ‘students’ and experts like Yaro and Gideon answer questions.

What it means for my readers is improved quality from here on in.

Suggestions on using LinkedIn

Enjoyed reading this article suggesting ways to use LinkedIn, especially numbers 1, 7 & 8.

Re: #1 – I think it is important to fill in plenty of detail on LinkedIn – if I visit your LinkedIn profile and find that I can’t get to know you better then it has failed for you. By telling me (or telling a potential client/employer) more about yourself can only be a good thing.

Re: #7 & #8 – I’m going to work on these two over the next couple of weeks…

Changing the world one ACT at a time!

Do you love your job? I do. Let me tell you why. I get to change ‘someones’ world on a daily basis. And I love it. 

I do technical support for a small marketing firm, all of our clients use ACT!, which is a contact management application. When you show someone how they can improve their productivity, improve their bottom line they get excited, and by extenstion, so do I. 

Just this week we demo’ed a customisation that will totally change the clients ability to track the jobs they do, the items associated with those jobs, the people and all the rest of it. The client was literally getting out of his chair, walking around “of course”, “WOW!”, “does that mean…” – “yes it does”. It was a the HIGHLIGHT of my week. To have spent the time delving into their business to work out what they do, how they do it so as to figure out what they needed was fun, it was truely enjoyable, but to see the reaction, the excitement, the realisations for what would now be possible – that was GOLD.

I love my job.

[note: the title “Changing the world one ACT at a time!” is a hat tip to an insightful guy with a Blue Monster]

[note: edited to fix a typo and add URL for www.evolutionmarketing.com.au]

When SharePoint barfs

A client has a SharePoint installation that has died, with all their project files and data in it.

In the course of searching for how to resurrect it, I’ve found the following that seem to be things that others may well benefit from:

Possibly the biggest lesson here is to ensure that if your using SharePoint, make sure you back it up PROPERLY, ALL OF IT.

Which version of .NET

Sometimes while supporting products, it is very useful to know just what version/s of .NET are installed.

Found this tool just now shows you just that: Free DotNet VersionCheck Utility

If you’ve ever wanted a quick way to find out which versions and service packs of the .NET runtime are installed on a machine, or if you’re trying to resolve a ‘missing mscoree.dll’ error, then DotNET Version Checker is for you.

VersionCheck itself does not depend on the .NET runtime.

VersionCheck will also tell you whether you have the required Windows components to run .NET applications, and will prompt you with download locations if not.

Update: this page at Microsoft lists the downloads for .NET in the left menu bar.