如何在power shell中设置COM+服务器类型应用程序的身份为网络服务



我需要做以下事情。

创建com+应用程序->将激活类型设置为服务器类型->将身份设置为网络服务->在创建者所有者下添加用户组。

我可以设置激活类型,但我不能设置身份和进一步的步骤。我是com+应用程序的新手。我写的脚本如下

$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
$apps = $comAdmin.GetCollection(“Applications”)
$apps.Populate();
$newComPackageName = “test7”
$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("Activation") = 1
$newApp1.Value("identity").Access="NT AUTHORITYsystem"
$newApp1.Value("Password") = ""
$saveChangesResult = $apps.SaveChanges()
“Results of the SaveChanges operation : $saveChangesResult”
}

我得到的错误是身份值不正确。请帮忙:)

您可能已经在这一点上修复了这个问题,但我相信这个问题可能是2件事中的1件,这取决于您收到的错误。

  1. 身份或密码无效-所以请确保您使用的是有效的凭据

  2. 可能是一个无效的参数。在这种情况下,我认为将"identity"更改为"identity"应该可以正常工作。例如:

$newApp1.Value("Identity") ="DOMAINusername" $newApp1.Value("Password") = "password"

最新更新