Solved

Powershell scripts to update complus application

Posted on 2013-05-23
3
1,235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 40

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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

690 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