3

Earlier I was using code as below to grab COM+ applications and verify that my app is running

COMAdmin.COMAdminCatalog catalog = new COMAdmin.COMAdminCatalogClass();
catalog.Connect(servername);
catalog.GetCollection("Applications")

Now I need to perform the same actions but from other domain. So when I try to run the code above I receive authentication error. I have tried to connect via WMI and grab list of COM+ applications from win32 wmi providers, but it seems that it's either not possible or I am doing smth wrong.

I would be pleased if someone could help me to get the list of applications from COMAdminCatalog using credentials.

Armedian
  • 33
  • 8
  • I don't have an answer for you, but please just verify that using the actual IP address of the server when connecting is also failing (instead of servername). – Stein Åsmul May 02 '14 at 20:28
  • Yes, it also results in authentication error as it tries to authenticate with user I'm logged in with and it does not have admin rights in target domain. For ex: I am running from: ADomain\John.Smith - admin in ADomain Target PC: BDomain\J_Smith - admin in BDomain That is why I am trying to find a way for remote authentication. – Armedian May 03 '14 at 07:54

1 Answers1

1

You will have to impersonate a different user on the current thread.

using (ImpersonatedUser user = new ImpersonatedUser("USER_NAME", "DOMAIN_NAME", "USER PASSWORD"))
{

    COMAdmin.COMAdminCatalog objCatalog = new COMAdmin.COMAdminCatalog();
    objCatalog.Connect("SERVER_NAME");

    COMAdmin.COMAdminCatalogCollection objAppCollection =
        (COMAdmin.COMAdminCatalogCollection) objCatalog.GetCollection("Applications");

    objAppCollection.Populate();

}

For more details: