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?

1

1 Answer 1

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
3
  • 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, 2014 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 Oct 28, 2014 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, 2014 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .