Solved

Powershell scripts to update complus application

Posted on 2013-05-23
3
1,145 Views
Last Modified: 2013-05-30
I am getting this error when i ran this script to update the Identity of complus application .




I want set this value mention in screenshot



ERROR:

 

Property 'Identity' cannot be found on this object; make sure it exists and is settable.
At line:19 char:14
+         $app. <<<< ("Identity") = "NT AUTHORITY\NetworkService"
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException
 
This COM+ Application already exists : RCSClient


Powershell scripts:


$ApplicationName = "RCSClient"
#Const AccountName = "NT AUTHORITY\NETWORK SERVICE"

$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
[String]$apps = $comAdmin.GetCollection(“Applications”)
$apps.Populate();



foreach ($app in $apps)
{

    if ($app = $ApplicationName)
 
        {        
       
  write-host "test $app"
        $app.("Identity") = "NT AUTHORITY\NetworkService"
   
        “This COM+ Application already exists : $appExistCheckAppName”
        }
    Else


{
write-host " application not found"
}


}
0
Comment
Question by:OM2013
  • 2
3 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39196885
try this:
$ApplicationName = "RCSClient"
#Const AccountName = "NT AUTHORITY\NETWORK SERVICE"

$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
[String]$apps = $comAdmin.GetCollection("Applications")
$apps.Populate();

foreach ($app in $apps)
{
	if ($app = $ApplicationName)
	{         
		write-host "test $app"
		$app.Value("Identity") = "NT AUTHORITY\NetworkService"
		"This COM+ Application already exists : $appExistCheckAppName"
	}
	Else{
		write-host " application not found"
	}
}

Open in new window

0
 
LVL 39

Expert Comment

by:footech
ID: 39206406
Quick correction to the above.  Line 10 should be
if ($app -eq $ApplicationName)

Open in new window

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39206791
@footech
of course, my mistake.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now