How do you administer COM+ from PowerShell?
List COM+ components
$comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1")
$applications = $comAdmin.GetCollection("Applications")
$applications.Populate()
foreach ($application in $applications)
{
$components = $applications.GetCollection("Components",$application.key)
$components.Populate()
foreach ($component in $components)
{
$dllName = $component.Value("DLL")
$componentName = $component.Name
"Component Name:$componentName"
"DllName: $dllName`n"
}
}
Stop/Start Components
$comAdmin.StartApplication("appName")
$comAdmin.ShutdownApplication("appName")
Install Com+ application using the InstallApplication method
# Refer to: http://msdn.microsoft.com/en-us/library/ms681806(v=vs.85).aspx
$comAdmin.InstallApplication("fileName")