Powershell COM+ settings

后端 未结 2 1681
轻奢々
轻奢々 2021-01-05 20:15

I\'m trying to set the following values with the powershell COMAdmin.COMAdminCatalog but I can\'t find the setting for the below in red. Any help would be appreciated.

2条回答
  •  情书的邮戳
    2021-01-05 20:53

    This was already answered, but here is my "Create New COM+ Application AND set property" script.

    $comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
    $apps = $comAdmin.GetCollection("Applications")
    $apps.Populate();
    
    
    $newComPackageName = "MyFirstCOMPackage"
    
    $appExistCheckApp = $apps | Where-Object {$_.Name -eq $newComPackageName}
    
    if($appExistCheckApp)
    {
        $appExistCheckAppName = $appExistCheckApp.Value("Name")
        "This COM+ Application already exists : $appExistCheckAppName"
    }
    Else
    {
        $newApp1 = $apps.Add()
        $newApp1.Value("Name") = $newComPackageName
        $newApp1.Value("ApplicationAccessChecksEnabled") = 0 <# Security Tab, Authorization Panel, "Enforce access checks for this application #>
        $saveChangesResult = $apps.SaveChanges()
        "Results of the SaveChanges operation : $saveChangesResult"
    }
    

提交回复
热议问题