1 Reply Latest reply on Apr 26, 2012 2:56 AM by dwebb

    assigning an eepc user fails

      hi,

       

      we're having issues with assigning an eepc user.

      we're using the following script which is delivered with the eepc 6.1.2 extensions.

       

      -----------------------------

      # Copyright (C) 2011 McAfee, Inc.  All Rights Reserved.
      # -*- coding: utf-8 -*-
      #
      # This is a sample script that demonstrates assigning a user to a single system
      # where the LDAP Server is automatically detected.

      import sys
      import mcafee

       

      epoServerName   = 'servername'
      epoServerPort   = 'port'
      epoUserName     = 'username'
      epoUserPassword = 'password'
      dnToAssign = 'CN=user1,OU=Users,OU=test,DC=test,DC=com'
      computerName = 'hostname'

       

      print 'Attempting connection to ePO Server.'
      #initiate connection
      mc = mcafee.client(epoServerName, epoServerPort, epoUserName, epoUserPassword)

      # Attempt to locate the computerId to assign the user to.
      print 'Attempting to obtaining Computer ID for ['+computerName+']'
      computer = mc.system.find(computerName);

      if len(computer) == 0:
      print 'Failed to find the computer id'
      sys.exit()
      if len(computer) != 1:
      print 'More than 2 computers found, script was designed to work with one computer only'
      sys.exit()
      computerId = computer[0].get('EPOComputerProperties.ParentID')


      # If you wish to list the current user assignments uncomment the following line, which includes the users assigned via LDAP groups/ous
      #print mc.core.executeQuery(target="EPESystemUsers", where='(where ( eq EPOLeafNode.NodeName "%s" ))' % computerName)

      result = mc.eeadmin.assignUser(systemNode='True', nodeId='%d' % computerId, dn='%s' % dnToAssign)
      print result
      if result != 'Succeeded':
      print 'Failed to assign the item';
      sys.exit()

       

      # If you wish to list the current user assignments uncomment the following line, which includes the users assigned via LDAP groups/ous
      #print mc.core.executeQuery(target="EPESystemUsers", where='(where ( eq EPOLeafNode.NodeName "%s" ))' % computerName)
      print 'Finished'

      -----------------------------------------

       

      there is no actual error except the output from "print 'Failed to assign the item';" , even in debug mode.

      if i run this script on a client it looks like this:

       

      C:\Python27>python.exe -d "assignuser.py"

      Attempting connection to ePO Server.

      Attempting to obtaining Computer ID for [xxxx]

      Failed

      Failed to assign the item

       

      Python version is 2.7.2

      Any ideas whats wrong here?

       

      Thans in advance!

        • 1. Re: assigning an eepc user fails
          dwebb

          Looks like epo cannot find a machine with the name you specified.

           

          Would recommend you check the server logs to see what happenned on the server in response to your request to find the machine.  It will likely give you a clue as to what is wrong in your script.