Monthly Archives: September 2014

Plex Media Server as a Service with Service Account

I had Plex Media Server already running for some time as a Service using srvany.exe from the Resource Kit. Additionally I managed to also configure it to use a Service Account. It was working but not perfect, there were too many hacks to get it working correct.

PMS as Service

Now that there is a better solution from Plex called PMS as Service I changed my configuration. I re-used the Service account that I was already using but starting the service failed. A quick look at the event log provided the essential information of the issue:

Service cannot be started. System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\Plex Service\plexServiceLog.txt' is denied.
 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
 at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
 at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
 at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
 at System.IO.StreamWriter..ctor(String path, Boolean append)
 at System.IO.File.AppendText(String path)
 at PlexMediaServer...

Access Rights Issue

To fix this, I’ve configured the required user rights for the Plex Service Account:

Plex Service Access Rights

Integrate Office 2013 Post SP1 Updates and Hotfixes

The installer from Microsoft Office supports integration of Updates by placing the MSP files in the Updates folder of the installation medium.

The challenge is more in getting all the update files. Fortunate there are a few great community users that have created WHDownloader for downloading these files and they also maintain the list of applicable updates.

Download the Updates

  1. Run WHDownloader.
  2. Click the button in the upper left to download all latest update lists.
  3. Select the Office 2013 version.
  4. Configure a Download Target folder.
  5. Select all General Updates and Hotfixes for downloading. Tip, right click and Select All.
  6. Let it download, this can take some time…
WHDownloader Office 2013 Post SP1

WHDownloader Office 2013 Post SP1

Extract MSP Files

The downloaded files are all self extracting executables that can be extracted through a few simple command line parameters:

update.exe /quiet /extract:C:\Users\Administrator\Downloads\Updates\MSP\

To do this for all scripts, use a PowerShell script like:

$files = Get-ChildItem "C:\Users\Administrator\Downloads\Updates\"

foreach($file in $files)
& $file.FullName /quiet /extract:"C:\Users\Administrator\Downloads\Updates\MSP\"

Move all extracted files into the Update folder of the Office Installation Media and done!


The installer will pick up the files automatically. To confirm, review the installed updates list after the installation. It should list all updates as installed:

Office Updates Installed

Office Customization Tool Missing

My Technet Subscription only gives me access to a Retail version of Microsoft Office 15. So no, Office Customization Tool. Running setup.exe /admin confirmed that with the error message: 

Files necessary to run the Office Customization Tool were not found. Run Setup from the installation point of a qualifying product.

Files necessary to run the Office Customization Tool were not found. Run Setup from the installation point of a qualifying product.

However, you can easily fix this by downloading the Office 2013 Administrative Template files (ADMX/ADML) and Office Customization Tool. Run the executable and let it extract to a temporary location.

Copy the admin folder to the installation source of Office 2013 and setup.exe /admin will start the Office Customization Tool.

Running Virus Scan Software on Forefront Threat Management Gateway

Found a great resource today that lists all the exceptions that Microsoft advises to configure when running Virus Scan Software on Forefront Threat Management Gateway.

In general I have the feeling that fine tuning the Virus Scan Exception policy is something that is not or hardly done. In most cases the products function correct, but a large performance penalty might be introduced that is not needed. If a few exception rules are configured, a lot of wasted resources can be won back.

TMG Logging Events MSSQL$MSFW 17204 and 17207

While working on the configuration of my TMG Server I observed inconsistent behavior and slow system performance. After a quick investigation I noticed a number of log entries after a system reboot in the Event Log.

The entries came from MSSQL$MSFW with Event IDs 17204 and 17207. Additionally I noticed that the Default Log Queue location of TMG (C:\Program Files\Microsoft Threat Management Gateway\Logs) was filled up with more then 650.000 files consuming 14 GBytes of system disk space.

Root Cause

The problem is that for some reason one or more databases had become corrupt and prevented SQL Server from correctly starting up and processing log entries from TMG. Therefore Forefront TMG falls back to its Log Queue.

Since the issue was already going on for some time in my case, I could not establish the root cause that caused the Database files to corrupt in the first place. But I do recall a BSOD from some time ago on the host OS due to a driver issue. That probably caused the issue.

Remove Corrupt Databases

I found a solution on the Microsoft Forums that describes how to remove the corrupt databases from Microsoft SQL Server in order to get SQL Server back in business.

  1. Start an command prompt and connect to the SQL Server database with the SQL Server Command Line Tool: OSQL -S %TMGComputerName%\msfw -E
  2. Delete each corrupt database with the following command: DROP DATABASE %DATABSENAME%
  3. Execute the commands by entering the command GO.
  4. Restart the SQL Server service for the SQL Server Instance msfw.
  5. Verify in the Event Log that no new corrupt databases are logged, if so repeat steps  1 to 4 until no events 117204 and 11207 are logged.

Log Queue

Once the SQL Server becomes available, the Log Queue should start processing again and write all queued up entries to the SQL Database. This can be monitored from the Management Console.

In my case it took a couple of hours due to the size.

TMG Log Queue Status

TMG Log Queue Status