Solved

Powershell scripts to update complus application

Posted on 2013-05-23
3
1,161 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

932 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

11 Experts available now in Live!

Get 1:1 Help Now