How do we able to retrieve Value from COM+ setting?

(imported topic written by Tiffy91)

Hi,

I’m want to check the value in the COM+ setting for Audit purposes.

In the Component Service, there are some COM+ Application setting.

For example,

In the Component Service, COM+ Application -> .Net Utilities - > Properties -> Activation Tab, I want to know how can i retrive the value in the Remote Server Name. i found some information from http://msdn.microsoft.com/en-us/library/aa394107(VS.85).aspx , it’s regarding Win32_COMSetting Class from wmi.

How to write a BigFix relavance script to retrive the Remove server name by using Wmi or any other method.

Please help.

Thank you.

(imported comment written by NoahSalzman)

Tiffy,

The general way to gather values from Win32_COMSetting would be:

(names of it, string values of it) of selects “* from Win32_COMSetting” of wmi

The specific way to get RemoteServerName is

(names of it, string values of it) of selects “RemoteServerName from Win32_COMSetting” of wmi

However, the latter case seems to produce an error in the WMI subsystem more often than not. It is not clear to me why that happens (it has been noticed in other threads in the Forum as well). In any case, give it a try and see if it works for you.

IMPORTANT: be very wary of any relevance that causes an Active Directory look-up. When you multiply the effect of that look-up over 100s of computers you can DoS your AD server.

Noah

(imported comment written by Tiffy91)

I’m checking on the script below regarding the “RemoteServerName” from Win32_COMSetting but there are several “RemoteServerName” exists. when i trial to get the value, it’s show the error below.

What is this error mean?

Q:Property “RemoteServerName” of select object “* from Win32_COMSetting” of wmi

E: The expression could not be evaluated: Windows Error: unknown error 0x80041002

Q: exists “RemoteServerName” of selects “* from Win32_COMSetting” of wmi

A: True

T: 4782.728 ms

I: singular boolean

(imported comment written by Tiffy91)

the unknown error 0x80041017 showing when ever i try to get infomation from RemoteServerName from Win32_COMSetting. Any bigfix relavance able to get this done beside than wmi??

Q:(names of it, string values of it) of selects “RemoteServerName from Win32_COMSetting” of wmi

E: The expression could not be evaluated: Windows Error: unknown error 0x80041017

Q: selects “RemoteServerName from Win32_COMSetting” of wmi

E: The expression could not be evaluated: Windows Error: unknown error 0x80041017

(imported comment written by BenKus)

Hi Tiffy,

I don’t recommend using WMI for this because it takes way too long and uses to many resources… Probably the best approach will be to find some sort of script or command-line tool to get this info and then retrieve the output through BigFix… (unless you can find the info in the registry)…

Ben

(imported comment written by Tiffy91)

Hi Ben,

if i already have a script ready, i have to use Action to push the action script before i able to retrive the information?

I’m not so familiar with this, i got this script as below. What should I do with this?

internal void RetrieveValue(bool readOnly, string targetValue)

{

ICOMAdminCatalog catalog = new COMAdminCatalogClass();

if (Handler.Machine.Name != System.Environment.MachineName)

catalog.Connect(Handler.Machine.Name);

ICatalogCollection apps =

(ICatalogCollection)catalog.GetCollection(“Applications”);

apps.Populate();

for (int i = 0; i < apps.Count; i++)

{

ICatalogObject app = (ICatalogObject)apps.get_Item(i);

if (String.Compare(app.Name.ToString(), this._appName, true) == 0)

{

if (app.get_Value(“ApplicationProxy”).ToString() == “True”)

{

this.CurrentValue = app.get_Value(“ApplicationProxyServerName”).ToString();

if (!readOnly)

{

app.set_Value(“ApplicationProxyServerName”, targetValue);

apps.SaveChanges();

}

}

}

}

if (this.CurrentValue == null)

this._errorMessage = String.Format(“The application ‘{0}’ is not installed on the SC.”, _appName);

}

(imported comment written by BenKus)

Hey Tiffy,

Yes, the goal will be to execute the script and then write the results to a file (or maybe registry) and then return the results in a property…

Is this Java code? Have you tried running this code on one of your computers? What was the command line you used to run this code and what were the results?

Ben

(imported comment written by Tiffy91)

Hi Ben,

this code is write in C# but i’m not the developer. it’s function as a utility tools for checking configuration and it did not store the value in a specific location.

Do you have a similar action script that allow me to retrive this COM + setting and store it some where??

Tiffy

(imported comment written by BenKus)

Hi Tiffy,

I don’t know of any way to get these settings and I don’t believe there are any built-in functions to BigFix that will help you. BigFix can still be of help to allow you to distribute a tool/script/command to capture the data and then retrieve it in a property, but first we need to figure out how to get it on one computer.

The C# code here will need to be compiled to make sure it works properly, but you will need to find a way to do that…

I did a quick google search to see if I could find a tool that listed the settings, but I didn’t have much luck, but I think searching around a bit more is your best bet.

Sorry for not having better answers…

Ben