I am trying to check the Run application as NT Service box for an application in COM+ in Component Services using PowerShell.
Does anyone know the $component.Value(s) to do this?
Any help would be greatly appreciated!
I am trying to check the Run application as NT Service box for an application in COM+ in Component Services using PowerShell.
Does anyone know the $component.Value(s) to do this?
Any help would be greatly appreciated!
In my case:
$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
$comAdmin.ShutdownApplication("MqsAgent2")
$applications = $comAdmin.GetCollection("Applications")
$applications.Populate()
foreach ($application in $applications)
{
if ($application.Name -eq "MqsAgent2")
{
$application.Value("Changeable") = $true
}
}
$applications.SaveChanges() | Out-Null
$comAdmin.StartApplication("MqsAgent2")
**$comAdmin.CreateServiceForApplication("MqsAgent2","MqsAgent2","SERVICE_AUTO_START","SERVICE_ERROR_CRITICAL","",".\MqsAgentUser","P@ssw0rd",$False)**
$comAdmin.ShutdownApplication("MqsAgent2")
$applications = $comAdmin.GetCollection("Applications")
$applications.Populate()
foreach ($application in $applications)
{
if ($application.Name -eq "MqsAgent2")
{
$application.Value("Activation") = "1"
$application.Value("Identity") = ".\MqsAgentUser"
$application.Value("Password") = "P@ssw0rd"
}
}
$applications.SaveChanges() | Out-Null
Hope it helps)