Theme:
COM+ Powershell Script
Rating: 124 user(s) have rated this article Average rating: 4.9
Posted by: Chandra Hundigam, on 8/2/2009, in category "Windows PowerShell"
Views: this article has been read 413582 times
Abstract: Recycle COM+ using Powershell.COM+ Application recycling can significantly increase the overall stability of your COM+ applications by offering a quick fix for known problems and helping to protect against unexpected ones.

Introduction

As a system administrator or a developer you will always come across several situations to recycle a COM+ application, Start and Shutdown COM+. In this small article it gives idea how to interact with COM+ application using Powershell scripting.

COM+ Application recycling can significantly increase the overall stability of your COM+ applications by offering a quick fix for known problems and helping to protect against unexpected ones. For example, application performance can degrade over time because of problems such as memory leaks, nonscalable resource usage, and process failure. COM+ provides application recycling as a solution to these problems. You can use application recycling to automatically shut down a process and restart it, thus reinitializing a failing process and reallocating memory it uses.


COM+ Overview


COM+ is the name of the COM-based services and technologies it automatically handles programming tasks such as resource pooling, disconnected applications, event publication and subscription and distributed transactions.

A COM+ application is the primary unit of administration and security for Component Services and consists of a group of COM components that generally perform related functions. These components further consist of interfaces and methods, as shown in the following illustration.
You can use the Component Services administrative tool to create new COM+ applications, add components to applications, and set the attributes for an application and its components.

COM+ diagram

Coming back to Powershell one can connect to the COM+ using COMAdminCatalog class. This enables you to access collections in the catalog, install COM+ applications and components, start and stop services, and connect to and administer remote servers. 

 

Powershell Script to Shutdown COM+ Application


$RemoteMachine = "TestMachine"
$COMPlusAppName = "TestApp"
$comObj = New-Object -comobject COMAdmin.COMAdminCatalog
$comObj .Connect($RemoteMachine)
$comObj .ShutdownApplication($COMPlusAppName)

 

Powershell Script to start COM+ Application


$RemoteMachine = "TestMachine"
$COMPlusAppName = "TestApp"
$comObj = New-Object -comobject COMAdmin.COMAdminCatalog
$comObj .Connect($RemoteMachine)
$comObj .StartApplication($COMPlusAppName)

 


More on COM+ references

You will also find information on COM+.


About Author
Chandra Hundigam
Author image I have Master’s degree in Computer Application, Microsoft Certified Professional and Software Architect. My experience significantly involved in enterprise application development and distributed object oriented system development using Microsoft .Net technologies to serve global giants in the Media, Finance, Mortgage and Software Industries. I am currently doing Independent Software Consultation for various US-based companies.

How would you rate this article? 1-Poor and 5-Excellent

User Feedback

Post your comment
Name:
E-mail:
Comment:
Insert Cancel
Translate
Search

 
Top Rated Articles
Popular Articles
Popular Links
Newsletter
Register to the site for free, and subscribe to the newsletter. Every month you will receive new articles and special content not available elsewhere on the site, right into your e-mail box!

Archived Newsletters