Powershell设置COM Plus组件的TransactionIsolation级别

时间:2013-05-13 11:14:59

标签: powershell com powershell-v2.0

如何通过powershell脚本将COM PLUS组件的TRANSACTION ISOLATION LEVEL设置为Any。 我正在尝试使用以下代码

  $comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
    $apps = $comAdmin.GetCollection(“Applications”)
    $apps.Populate();

    foreach($app in $apps)
    {
    Write-Host $app.Name
        if($app.Name -eq $ApplicationName)
        {
         $components = $apps.GetCollection("Components",$app.key)
         $components.Populate()


             foreach ($component in $components)
             {
                $componentName = $component.Name;                
                Write-Host "*"$componentName;   
                if($componentName -eq "WDA_DUP.Generic13")
                {
                $component.Value("TXIsolationLevel")=COMAdminTxIsolationLevelAny;
                }                  
             } 
        }   
    }

但没有达到目的。请帮帮我:)      `

1 个答案:

答案 0 :(得分:1)

工作脚本:

to