Powershell COM+ settings
Asked Answered
A

2

5

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.

Value looking to set

Thanks

Ashur answered 28/6, 2011 at 15:21 Comment(0)
K
5

For the properties in question see the Authentication property and the AccessLevelChecks property for the Applications Collection under COM+ Administration Collections.

For a VBScript example on how to set the Authentication Level property see the answer to changing existing COM+ applications identity via vbs script.

It should be fairly straight forward to convert to PowerShell. Here's my guess:

$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
$apps = $comAdmin.GetCollection("Applications")
$apps.Populate();
$app = $apps | Where-Object {$_.Name -eq "MyAppName"}

# Set Authentication to Packet Authentication
$app.Value("Authentication") = 4 

# Set Security Level to Process and Component level
$app.Value("AccessChecksLevel") = 1 

$apps.SaveChanges()
Kutenai answered 29/6, 2011 at 14:10 Comment(5)
hi, thanks. i had to put authentication to 1 for 'none' and 0 for the accesscheckslevel but was more looking for the value i had to set.Ashur
OK, you can get all the values from the Applications Collection documentation link.Kutenai
one of the things that drives me nuts (with microsoft) is there is no setting constant (AccessChecksLevel) association with the Tab and Panel (text) on the screen. And you have to experiment to figure out which is which. :<Exorcism
I would like to see (in the documentation) something like "ApplicationAccessChecksEnabled" = <# Security Tab, Authorization Panel, "Enforce access checks for this application #>Exorcism
Same thing with TSQL replication. There are like over 100+ settings...and the constants vs the "text on the screen" are not very clear at all.Exorcism
E
4

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"
}
Exorcism answered 2/8, 2012 at 21:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.