Forum Discussion
7 years ago
Brandon,
I have modified the code slightly to get rid of the annoying open and close brackets(my OCD kicked in hard).
groovy script:
hostname=hostProps.get("system.hostname")
my_query="Select NAME from Win32_serverfeature"
def session = WMI.open(hostname);
import com.santaba.agent.groovyapi.win32.WMI
def result = session.queryAll("CIMv2", my_query, 15);
def strResult = result.NAME.toString();
def finalOutput = strResult.replace("["," ").replace("]"," ");
println "WindowsFeatures=" + finalOutput
P.S. - this script is awesome!
Related Content
- 7 months ago
- 2 years agoAnonymous