Powershell COM+设置

发布于 2024-11-17 13:30:42 字数 153 浏览 2 评论 0 原文

我尝试使用 powershell COMAdmin.COMAdminCatalog 设置以下值,但找不到以下红色的设置。任何帮助将不胜感激。

要设置的值

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

送舟行 2024-11-24 13:30:42

有关相关属性,请参阅 身份验证属性AccessLevelChecks 属性 应用程序集合 rel="nofollow noreferrer ">COM+ 管理集合。

有关如何设置身份验证级别属性的 VBScript 示例,请参阅 通过 vbs 脚本更改现有 COM+ 应用程序身份

转换为 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()

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()
倾城花音 2024-11-24 13:30:42

这个问题已经得到解答,但这是我的“创建新的 COM+ 应用程序并设置属性”脚本。

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

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"
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文