1

I've got a Windows Server 2003 SBS SP2 box.

It's hosting our business application.

About once a week the clients for the application on work stations throughout the office get so they receive an "Unable to contact business server" error message.

At this point I remote to the SBS

run "dcomcnfg" Console Root > Component Services > Computers > My Computer > Running Processes.

In there, I right click the icon for the application and run a recycle. As soon as this process has completed my clients can communicate with the server again.

My question is, can this be automated to be recycled once a day? Do I need to do it via the command line and write a batch script to do this? If this is the case what are the command line statements?

If it can be done in the GUI somewhere can you point me in the right direction?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
todbanner
  • 11
  • 1
  • 2
  • Get rid of it. It's time to start thinking about how to migrate this to a more modern platform. [Much of SBS 2003 is already out of support, and the core OS will be out of support in 9 months](http://blogs.technet.com/b/sbs/archive/2013/09/25/information-about-sbs-2003-product-support-lifecycle.aspx). – HopelessN00b Oct 29 '14 at 13:01

1 Answers1

1

You can use PowerShell to interact with the Component Services catalog and set the "RecycleLifetimeLimit" value to the number of minutes the application should run before recycling:

$TargetAppName = "todbannersBiznezApp"

$ComCatalog = New-Object -ComObject COMAdmin.COMAdminCatalog
$ComCatalog.Connect("localhost")

$ComApps = $ComCatalog.GetCollection("Applications")
$ComApps.Populate()

foreach($App in $ComApps)
{
    if($App.Name -eq $TargetAppName)
    {
        # 30240 (21 days) is the maximum lifetime value
        # Let's set it to 1440 (24 hours) 
        $App.Value("RecycleLifetimeLimit") = 1440
        $ComApps.SaveChanges()
        break
    }
}

You can also do it from the Component Services management console if you like:

  1. Open the Component Services management console (run -> comexp.msc)
  2. Go to Component Services -> Computers -> My Computer/Localhost
  3. Expand COM+ Applications
  4. Right-click your business application and select Properties
  5. Switch to the "Pooling and Recycling" tab
  6. Configure the desired recycle settings for the app
Mathias R. Jessen
  • 25,161
  • 4
  • 63
  • 95
  • I don't seem to have comexp.msc, but I found the same options under dcomcnfg. I will see how that goes. Thanks. – todbanner Oct 28 '14 at 19:19
  • comexp.msc is the 2008 version, sorry about that... I've never tested this on a 2003 box, it might be different – Mathias R. Jessen Oct 28 '14 at 19:23
  • Well the pooling and recycling tab was there with the ability to set a time limit between recycling. So i would assume it will have the desired effect. – todbanner Oct 28 '14 at 19:29