Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found out how to do it.</p> <p>Apparently I have to get a collection of COM+ applications, find the one I want (by name), then get a collection of components in the application, then go through the collection and set the attribute:</p> <pre><code> //get collection of applications COMAdminCatalog catalog = new COMAdminCatalog(); catalog.Connect("127.0.0.1"); COMAdminCatalogCollection applications = (COMAdminCatalogCollection)catalog.GetCollection("Applications"); applications.Populate(); //no idea why that is necessary, seems to be // appId for the application we are looking for object appId = new object(); int count = applications.Count; ICatalogObject item; if (count == 0) return; //search collection for item with name we are looking for for (int i = 0; i &lt; count; i++) { item = (ICatalogObject)applications.get_Item(i); if (applicationName == (string)item.get_Value("Name")) { appId = item.Key; Console.WriteLine("appId found for " + applicationName + ": " + appId.ToString()); } } // get all components for the application COMAdminCatalogCollection components; components = (COMAdminCatalogCollection)applications.GetCollection("Components", appId); components.Populate(); // again, no idea why this is necessary // set the attribute in all components foreach (COMAdminCatalogObject component in components) { Console.WriteLine("Setting IISIntrinsics attribute in " + component.Name + "."); component.set_Value("IISIntrinsics", true); components.SaveChanges(); } </code></pre> <p>I think this can be done better and with fewer castings. But I don't know how.</p> <p>This will do.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload