$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
$apps = $comAdmin.GetCollection(“Applications”)
$apps.Populate();
$newComPackageName = “MyApplicationName”
$appExistCheckApp = $apps | Where-Object {$_.Name -eq $newComPackageName}
if($appExistCheckApp)
{
$appExistCheckAppName = $appExistCheckApp.Value(“Name”)
“This COM+ Application already exists : $appExistCheckAppName”
}
Else
{
$newApp1 = $apps.Add()
$newApp1.Value(“Name”) = $newComPackageName
$newApp1.Value(“ApplicationAccessChecksEnabled”) = 0 # Security Tab, Authorization Panel, “Enforce access checks for this application
$newApp1.Value(“Identity”) = “nt authority\localservice”
$saveChangesResult = $apps.SaveChanges()
“Results of the SaveChanges operation : $saveChangesResult”
}
read-host ‘Press enter key to continue . . .’
How did you figure out how to do this?
[…] boxes and prefer to automate as much as possible. After some online searching, I came across this blog post from Rikard Alard that has details on how to automate COM+ settings through PowerShell. This had […]