Powershell COM+ settings

末鹿安然 提交于 2019-12-19 07:48:16

问题


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.

Thanks


回答1:


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()



回答2:


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"
}


来源:https://stackoverflow.com/questions/6508874/powershell-com-settings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!