The following pseudocode shows one way to identify the profiles registered on the managed server. The pseudocode in this topic depends on the pseudocode in Make a Connection to the CIMOM.

To list registered profiles

1

Connect to the server URL.

Specify the Interop namespace, supplied as a parameter, for the connection.

use wbemlib
use sys
use connection renamed cnx
connection = Null

params = cnx.get_params()
if params is Null 
   sys.exit(-1)
interop_params = params
interop_params['namespace'] = 'root/interop'
connection = cnx.connect_to_host( interop_params )
if connection is Null 
   print 'Failed to connect to: ' + params['host'] + ' as user: ' + params['user']
2

Enumerate instances of CIM_RegisteredProfile.

function get_registered_profile_names( connection )
   ///Get instances of RegisteredProfile.///
   instance_names = connection.EnumerateInstanceNames( 'CIM_RegisteredProfile' )
   if instance_names is Null
      print 'Failed to enumerate RegisteredProfile.'
      return Null
   else
      return instance_names

instance_names = get_registered_profile_names( connection )
if instance_names is Null
   sys.exit(-1)
3

For each instance of CIM_RegisteredProfile, print the name and version of the profile.

function print_profile( instance ) 
   print '\n' + ' [' + instance.classname + '] ='
   for prop in ( 'RegisteredName', 'RegisteredVersion' )
      print ' %30s = %s' % ( prop, instance[prop] )

for instance_name in instance_names 
   instance = connection.GetInstance( instance_name )
   print_profile( instance )