I am writing a tool that will validate WebSphere settings of a web application. I want to be able to look up all possible values of a WebSphere variable (all scopes) by remotely connecting to the server through the java AdminClient object. I have already read another post about this and although I think I now have the correct code I am not able to use the AdminOperations MBean because the WebSphere account I have to use is not granted admin privileges. I would like to know if there is a way to resolve WebSphere variables without using AdminOperations. Thanks!
Here is my code so far (again, does not work due to privilege issues):
private static String expandVariable(AdminClient client, String s)
throws Exception
{
Set result = client.queryNames(new ObjectName("*:*,type=AdminOperations,process=exampleProcess"), null);
return (String)client.invoke((javax.management.ObjectName)
result.iterator().next(),"expandVariable",new Object[]
{"${"+s+"}"}, new String[] {"java.lang.String"});
}