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

北城以北 提交于 2019-12-08 02:39:41

问题


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.

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. 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 :)


回答1:


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.

  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"



来源:https://stackoverflow.com/questions/16293666/how-do-i-set-identity-of-com-server-type-application-to-network-service-in-powe

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