use powershell to set component services transaction timeout
com, powershell
Solution
Here's the working code:
$comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1")
$LocalColl = $comAdmin.Connect("localhost")
$LocalComputer = $LocalColl.GetCollection("LocalComputer",$LocalColl.Name)
$LocalComputer.Populate()
$LocalComputerItem = $LocalComputer.Item(0)
$CurrVal = $LocalComputerItem.Value("TransactionTimeout")
Write-Host "Transaction Timeout = $CurrVal"
$LocalComputerItem.Value("TransactionTimeout") = 20
$LocalComputer.SaveChanges()
I didn't think it was saving the changes because everytime I checked the Component Services | LocalComputer | Properties | Transaction Timeout it was still '60', even after I refreshed all components. I finally exited Component Services and came back in, then it had the '20' value.
Problem
I'm trying to automate an application deployment using Powershell. One step requires that I go into Component Services to My Computer properties and set the Transaction timeout to 0. The answer at Powershell COM+ settings seems the most promising answer to me, but I've been unable to map the Transaction Timeout setting. Looking at the COM+ Administration Collections page: http://msdn.microsoft.com/en-us/library/windows/desktop/ms687763(v=vs.85).aspx I see there is a LocalComputer collection but I'm unable to retrieve a properties collection from the LocalComputer collection object, which is where I guess the Transaction Timeout property would be. Here's my little exploratory code: ``` $comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1") $applications = $comAdmin.GetCollection("LocalComputer") $applications.Populate() $properties = $applications.GetCollection("PropertyInfo",$application.key) foreach ($property in $properties){ Write-Host $property.name } ``` Can anyone help me set the Transaction Timout? Update: This script at least gets me the TransactionTimeout value: ``` $comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1") $LocalColl = $comAdmin.Connect("localhost") $LocalComputer = $LocalColl.GetCollection("LocalComputer",$LocalColl.Name) $LocalComputer.Populate() $LocalComputerItem = $LocalComputer.Item(0) $LocalComputerItem.Value("TransactionTimeout") ```