简体   繁体   English

如何在Power Shell中将COM +服务器类型应用程序的标识设置为Network Service

[英]How do i set Identity of COM+ server type application to Network Service in power shell

I need to do the following thing. 我需要做以下事情。

Create com+ application -> set activation type to Server type-> set identity as Network service->Add user group under creater owner. 创建com +应用程序->将激活类型设置为服务器类型->将身份设置为网络服务->在创建者所有者下添加用户组。

I am able to set activation type,but i am not able to set identity and the further steps. 我可以设置激活类型,但不能设置身份和其他步骤。 I am new to com+ applications. 我是com +应用程序的新手。 the script i have written is as follows 我写的脚本如下

$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 AUTHORITY\system"
$newApp1.Value("Password") = ""

$saveChangesResult = $apps.SaveChanges()
“Results of the SaveChanges operation : $saveChangesResult”
}

The error i am getting is Identity value is not correct. 我收到的错误是身份值不正确。 Please help :) 请帮忙 :)

You probably fixed this at this point already, but I believe the issue could be 1 of 2 things, depending on the error you are receiving. 您可能已经解决了这一点,但是我认为问题可能是2件事情中的1件,具体取决于您收到的错误。

  1. The identity or password is not valid - so just make sure you are using valid credentials. 身份或密码无效-因此只需确保您使用的是有效凭据即可。

  2. It could be an invalid parameter. 它可能是无效的参数。 In that case I believe changing the 'identity' to 'Identity' and it should work fine. 在那种情况下,我认为将“身份”更改为“身份”,它应该可以正常工作。 For example: 例如:

$newApp1.Value("Identity") ="DOMAIN\\username" $newApp1.Value("Password") = "password"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM