Solved

Powershell scripts to update complus application

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Set OWA language and time zone in Exchange for individuals, all users or per database.
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…

733 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