Powershell COM + Settings

I am trying to set the following values ​​using powershell COMAdmin.COMAdminCatalog, but I can not find the settings for below in red. Any help would be appreciated.

Value looking to set

thank

+5
source share
2 answers

For the properties in question, see Authentication Property and AccessLevelChecks Property for Application Collection under COM + Administration Collections .

In the VBScript example on how to set the authentication level property, see the response to changing an existing COM + application identifier through a vbs script .

PowerShell . :

$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()
+5

, " COM + " 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"
}
+4

All Articles