I have this script where I'm trying to set the IISIntrinsic property for components of an application in Com+ in Component Services.
This is what I'm trying to tick
Here's my powershell script:
$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
# -- Shut down the running app
$comAdmin.ShutdownApplication("MyAppName")
# -- Loop through components
$applications = $comAdmin.GetCollection("Applications")
$applications.Populate()
foreach ($application in $applications)
{
if ($application.Name -eq "MyAppName")
{
$components = $applications.GetCollection("Components",$application.key)
$components.Populate()
foreach ($component in $components)
{
# -- Set property
$component.Value("IISIntrinsics") = $true
}
#-- EDIT - ADDING THIS LINE SOLVED THE ISSUE
$components.SaveChanges()
}
}
# -- Save and exit
$applications.SaveChanges()
# -- start the application again
$comAdmin.StartApplication("MyAppName")
Setting IISIntrinsics to true doesn't seem to have any impact.
My feeling is that
- Either $applications.SaveChanges() is the wrong thing to call OR
- The way I'm setting the property is incorrect (I also tried setting it to 1 without success)
Any help would be greatly appreciated!