?
Solved

Powershell scripts to update complus application

Posted on 2013-05-23
3
Medium Priority
?
1,261 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 1500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

801 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