0 Replies Latest reply on Feb 27, 2013 11:02 AM by dschaff

    So what if you have a large number of systems with different tags? (script included)

    dschaff

      This python script looks for for a flat file HostTags.csv with the hostname,tag on each row. Then it prints this and tags the systems in ePO.

       

       

      import csv, sys

      import mcafee, getpass

      epoadmin = raw_input('What is your ePO username?: ')

      epopasswd = getpass.getpass(prompt='What is your ePO password?: ')

      mc = mcafee.client('localhost','8443',epoadmin,epopasswd)

      filename = 'HostTags.csv'

      with open(filename, 'rb') as f:

          reader = csv.reader(f)

          try:

              for row in reader:

                               sysname = row[0]

                               epotag = row[1]

                               print 'Applying Tag',(epotag), 'to host',(sysname)

                               mc.system.applyTag(sysname,epotag)

          except csv.Error, e:

              sys.exit('file %s, line %d: %s' % (filename, reader.line_num, e))

       

      Message was edited by: dschaff on 2/27/13 11:02:37 AM CST