Registering script maps with .svc file extension’s on IIS7

November 13, 2010

By default there is no script map for files with the .svc file extension on a default IIS 7.0 installation,. To register the script map use the following command:

C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -r -y 

IIS: Creating a backup of your IIS7 configuration

October 7, 2010

Backing up IIS7 configuration is as simple as copying the \windows\system32\inetsrv\config directory (and subdirectories) into a backup directory, so you don’t need anything special to do it. Just include this directory in whatever your OS/content back-up plan is, or write a custom script to do it.

To help make managing backups easy, we’ve added a simple cmd-line option to AppCmd.exe that makes management of backup/restore sets easy. For example, to backup configuration, run the follow command:

 %windir%\system32\inetsrv\appcmd.exe add backup "My Backup Name"

to restore that backup, run this command:

 %windir%\system32\inetsrv\appcmd.exe restore backup "My Backup Name"

to delete a backup, run this command:

 %windir%\system32\inetsrv\appcmd.exe delete backup "My Backup Name"

More detail can be found here.


Powershell: A one line script to terminate all BizTalk suspended messages

October 7, 2010

Here is a quick powershell script which terminates all suspended messages on a local BizTalk Server host.

This script includes all service instances, you can however very easily modify the script for finer control to use any other different set of properties for each instance. For example if you included the condition ‘ServiceClass = 4’ as well you would be only terminating “messaging” service instances.

Here is the script.

Get-WmiObject MSBTS_ServiceInstance  -namespace 'root\MicrosoftBizTalkServer' -filter 'ServiceStatus = 4'  |`
%{Get-WmiObject MSBTS_ServiceInstance -namespace 'root\MicrosoftBizTalkServer' -filter "InstanceID = '$($_.InstanceID)'"} |`
%{ $_.Terminate()} |`
%{ Out-Null }

Enjoy!


BizTalk deployment using Windows PowerShell Part 1: Applications and Host Instances

September 24, 2010

Windows Powershell is the (not so) new command and scripting language from Microsoft. One of Powershell’s biggest features is the ability to leverage the power of the .NET framework directly from the command line. I am finding myself drawn to using Powershell more and more in many different scenarios, especially when I comes to automating deployment tasks.

BizTalk deployments are commonly made up of many different tasks spanning beyond just building, importing and installing a BizTalk solution. Often there are many pre and post build tasks which are required to complete the job. I have on occasion been involved in deployments which would have been simplified through automation with Powershell scripts.

In this series of posts I plan to post some of the scripts which I have written which can be reused or used as a guide to simplify common deployment tasks.

  1. Script 1 stops all running BizTalk applications (fully) and stops all host instances: BTSStopAllAppsAndHostInstance.ps1
  2. Script 2 starts all running BizTalk applications (fully) and starts all host instances:BTSStartAllAppsAndHostInstance.ps1

So what are contained within these scripts?

These scripts have been written for use against BizTalk Server 2009, and as such retrieve the BizTalk Server 2009 installation path from the windows registry. For control of the BizTalk Server applications, the Microsoft.BizTalk.Explorer.OM assemblies are used, while for the BizTalk host instances the Get-Service Powershell commandlet is used.

For more information I suggest reading up more about what I have done here using the following links: