Tres,
> I need to change the identity (user name and password) that a COM+
> application is running under on a remote machine. Does anyone have an
> example of remotely administering COM+ applications in .NET?
Do you really need to use .NET for this? Although you can certainly use COM
interop with ComAdmin.dll, It's just a simple 20- lines VBScript, which to
me, seems like a preferable choice for quick tasks like this ;)
Here's a short sample:
Dim appID
appID = "<Guid of the Application>"
Dim catalog, root
set catalog = CreateObject("COMAdmin.COMAdminCatalog")
set root = catalog.Connect("<server name or localhost>")
Dim appsCol
set appsCol = catalog.GetCollection("Applications")
appsCol.PopulateByKey Array(appID)
for each obj in appsCol
obj.Value("Identity") = "<domain and user name>"
obj.Value("Password") = "<password>"
next
appsCol.SaveChanges

Signature
Tomas Restrepo
tomasr@mvps.org
Tres Henry - 09 Jul 2004 19:14 GMT
Tomas Restrepo (MVP) wrote:
> Tres,
>
[quoted text clipped - 5 lines]
> interop with ComAdmin.dll, It's just a simple 20- lines VBScript, which to
> me, seems like a preferable choice for quick tasks like this ;)
Yeah, I ended up using comadmin.dll through interop. I would have done
it this way to begin with but I didn't realize that COMAdminCatalogClass
has a Connect() method that allows you to configure remote applications.
Still, shouldn't this be doable through WMI? I can't believe there
isn't a Win32_COMPlusApplication class or something like that.
Thanks for your help though!
Klaus H. Probst - 09 Jul 2004 19:22 GMT
I don't see why you'd need to complicate something that is complicated
enough by adding it to WMI.
The admin interfaces are hard to figure out but they work fine as they are,
and as you said, work perfectly well in remote mode.

Signature
Klaus H. Probst, MVP
http://www.vbbox.com/
> Tomas Restrepo (MVP) wrote:
> > Tres,
[quoted text clipped - 14 lines]
>
> Thanks for your help though!