Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft Technologies like Exchange, Office 365, Azure and Cloud Security.
On August 20, 2017
0 Comment
Last updated: 2017-08-20


SMTP SimulatorThe SMTP Simulator project has been started due to a specific demand during a customer project. We needed a solution to test native transport of Exchange Server 2013 and third party addons to Exchange in an isolated lab envrionment having no internet access at all.

While it is pretty easy to send test emails using PowerShell, we wanted to create an automated service which is capable of:

  • replies to incoming emails
  • has configured internal and external SMTP domains
  • creates random local email addresses
  • sends emails depending on a schedule to simulate user behaviour
    • fixed number of emails per timeframe
    • random number of emails per timeframe
    • send misformed emails
  • adds attachments to outgoing emails
    • documents 
    • archives / password protected archives
    • EICAR files
  • simple testing of POP3/IMAP4 remote connections 
  • runs as a Windows service
  • has a nice web interface for simplified administration
    • access to SMTP send/receice logs

The SMTP Simulator can be used with any Message Transfer Agents (MTA), not only with Exchange. Besides testing the MTA itself, we needed to test some of the following third-party solutions:

  • Anti-Malware solutions using an Exchange transport agent
  • SMTP gateway solutions

Architecure overview

SMTP Simulator Overview

Web client interface

Screenshot SMTP Simulator Web Client

The Visual Studio solution creates a MSI installer file. The MSI package created installs the SMTP Service itself, but not the required web application (see issue #49).

Documentation is provided by the SMTP Simulator Wiki.

Open Source

The code has been published as open source at Github. Feel free to fork the solution and contribute to the code.

Report any issues or feature requests at Github.


The project still has some open ends and needs some love and attention. Open issues are part of the issue tracker at Github.

Main topics are:

  • Authenticated login
  • Rebuild of the installer to include the main service component and the web client required for management
  • Enhance wiki documentation


Read More »
On August 19, 2017
0 Comment

The GlobalFunctions PowerShell module has been updated to support writing of log messages to the PowerShell output pipeline.

When writing to the PowerShell output pipeline, the severity level is not written to the pipeline. In most cases you will use this option for debugging purposes.


# Import module first
Import-Module -Name GlobalFunctions

# Create an instance of the logger
$ScriptDir = Split-Path -Path $script:MyInvocation.MyCommand.Path
$ScriptName = $MyInvocation.MyCommand.Name
$logger = New-Logger -ScriptRoot $ScriptDir -ScriptName $ScriptName -LogFileRetention 14 

# Write an informational message to the log file only
$logger.Write('Some informational message')

# Write an informational message to the log file only
$logger.Write('Some message to log and console',0,$true)

# Write a warning level message to log file and the message only to PowerShell output pipeline
$logger.Write('Some warning message',2,$true)


Remember to add the severity level when writing to console.


Read more about the GlobalFunctions module here.

You can get the source code here:

Read More »

When you run the following cmdlet to prepare Active Directory for the installation of an Exchange Server Cumulative Update (in this case CU17) you might encounter a System.UnauthorizedAccessException

D:\tmp\Cu17>setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms

Microsoft Exchange Server 2013 Cumulative Update 17 Unattended Setup

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\
Windows\Temp\ExchangeSetup\ExSetup.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
   at Microsoft.Exchange.Setup.CommonBase.SetupHelper.DeleteDirectory(String pat
   at Microsoft.Exchange.Bootstrapper.Setup.BootstrapperBase.CopySetupBootstrapp
   at Microsoft.Exchange.Bootstrapper.Setup.Setup.Run()
   at Microsoft.Exchange.Bootstrapper.Setup.BootstrapperBase.MainCore[T](String[
] args)
   at Microsoft.Exchange.Bootstrapper.Setup.Setup.Main(String[] args)


There is a simple reason for the the System.UnauthorizedAccessException:

  • .NET Framework Optimization Service 

The required .NET Framework 4.6.2 had been installed just minutes before executing setup.exe. Preparation of the Active Directory schema ran without any issues. But when the /PrepareSchema call finished, the temporary folder in C:\Windows\Temp\ExchangeSetup could not be fully cleaned up, as mscorsvw.exe had an open file handle on ExSetup.exe.

Additionally, when you run Setup.exe and the folder C:\Windows\Temp\ExchangeSetup exists, the setup will not try to copy required installation files. Regardless if the folder files exists in the folder or not.

.NET Optimization process running


  • End both mscorsw.exe processes or wait until both process have finished optimizing your .NET Framework applications
  • Manully delete the folder C:\Windows\Temp\ExchangeSetup
  • Run the required Exchange setup step again
D:\tmp\Cu17>setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms

Microsoft Exchange Server 2013 Cumulative Update 17 Unattended Setup

Copying Files...
File copy complete. Setup will now collect additional information needed for

Performing Microsoft Exchange Server Prerequisite Check

    Prerequisite Analysis                                     COMPLETED

Configuring Microsoft Exchange Server

    Organization Preparation                                  COMPLETED

The Exchange Server setup operation completed successfully.


Enjoy Exchange!







Read More »

Scheduled Maintenance Party at Ignite 2017At Microsoft Ignite, the major IT conference regarding Microsoft technologies, you will have a chance to award yourself with a scheduled maintenance sponsored by ENow.

Have you ever been to one of the legendary Scheduled Maintenance parties in the past? No? Then get your pass now

Vist the Scheduled Maintenance web site to request your pass now.









Read More »


This script deletes user from the NoSpamProxy NoSpamProxyAddressSynchronization database table [Usermanagement].[User] table that have not been removed by the NoSpamProxy Active Directory synchronization job.

The script was developed due to a process flaw in how Active Directory accounts are handled as part of a leaver process. So this script does not fix a software bug, but a process glitch.

Due to the Active Directory account process the accounts still exist in Active Directory and are synchronized to the NoSpamProxyAddressSynchronization database.

When executed without the -Delete parameter all identified users are wirtten the log file only.



# Check for Active Directory existance of all users stored in NoSpamProxy database. Do NOT delete any users from the database.


# Delete users from NoSpamProxy database hosted on SQL instance MYNSPSERVER\SQLEXPRESS that do NOT exist in Active Directory.

.\Remove-NspUsers.ps1 -Delete -SqlServerInstance MYNSPSERVER\SQLEXPRESS


Version History

  • 1.0, Initial community release





Read More »