2 Replies Latest reply on Sep 16, 2020 9:54 AM by Olivier Segers

    BMC REMEDYFORCE PENTAHO INTEGRATION WITH ACTIVE DIRECTORY

    S. Abu Owais Bin Nasar
      Share This:

      Hi All,

      I'm trying to import users from Windows Server Active Directory into my BMC Remedyforce by using the Pentaho Data Integration tool.

      All pentaho configuration done as per giving instruction on BMC Documentation and LDAP also configured.

      https://docs.bmc.com/docs/remedyforce/201802/en/importing-salesforce-platform-license-users-with-assigned-permission-sets-from-an-ldap-server-811764337.html

      but facing issue in "Dynamic account, profile and permission set assignment" step.

      ERROR

      2020/08/28 01:15:58 - Spoon - Using legacy execution engine

      2020/08/28 01:15:58 - Spoon - Transformation opened.

      2020/08/28 01:15:58 - Spoon - Launching transformation [TransferLDAPInfo]...

      2020/08/28 01:15:58 - Spoon - Started the transformation execution.

      2020/08/28 01:15:58 - TransferLDAPInfo - Dispatching started for transformation [TransferLDAPInfo]

      2020/08/28 01:15:58 - LDAP input.0 - Connected to server [LAB-ADFS.mylab.local] with username [mylab\test]

      2020/08/28 01:16:01 - Text Input[For Account].0 - Opening file: file:///C:/Users/test/Downloads/data-integration/LDAP 2.0 With Permissions/LookupData/Account.csv

      2020/08/28 01:16:01 - Text Input[For PermissionSet] .0 - Opening file: file:///C:/Users/test/Downloads/data-integration/LDAP 2.0 With Permissions/LookupData/PermissionSet.csv

      2020/08/28 01:16:01 - Text Input[For Profile].0 - Opening file: file:///C:/Users/test/Downloads/data-integration/LDAP 2.0 With Permissions/LookupData/Profile.csv

      2020/08/28 01:16:01 - Text Input[For Account].0 - Finished processing (I=8, O=0, R=0, W=7, U=1, E=0)

      2020/08/28 01:16:01 - Text Input[For Profile].0 - Finished processing (I=19, O=0, R=0, W=18, U=1, E=0)

      2020/08/28 01:16:01 - Text Input[For PermissionSet] .0 - Finished processing (I=31, O=0, R=0, W=30, U=1, E=0)

      2020/08/28 01:16:01 - Text Input[For UserRole].0 - Opening file: file:///C:/Users/test/Downloads/data-integration/LDAP 2.0 With Permissions/LookupData/Role.csv

      2020/08/28 01:16:01 - Text Input[For UserRole].0 - Finished processing (I=8, O=0, R=0, W=7, U=1, E=0)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - Optimization level set to 9.

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Unexpected error

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : org.pentaho.di.core.exception.KettleValueException:

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - Javascript error:

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - ReferenceError: "manager" is not defined. (script#44)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 -

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:475)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:541)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at java.base/java.lang.Thread.run(Thread.java:834)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "manager" is not defined. (script#44)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3848)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1781)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.gen.script_20._c_script_0(script:44)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.gen.script_20.call(script)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.gen.script_20.call(script)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.mozilla.javascript.gen.script_20.exec(script)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:388)

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - ... 3 more

      2020/08/28 01:16:01 - Dynamic account, profile and permission set assignment.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

      2020/08/28 01:16:01 - TransferLDAPInfo - Transformation detected one or more steps with errors.

      2020/08/28 01:16:01 - TransferLDAPInfo - Transformation is killing the other steps!

      2020/08/28 01:16:01 - Stream lookup[For PermissionSet].0 - Finished processing (I=0, O=0, R=30, W=0, U=0, E=0)

      2020/08/28 01:16:01 - Stream lookup[For Profile].0 - Finished processing (I=0, O=0, R=18, W=0, U=0, E=0)

      2020/08/28 01:16:01 - Stream lookup[For Account].0 - Finished processing (I=0, O=0, R=7, W=0, U=0, E=0)

      2020/08/28 01:16:01 - Stream lookup[For UserRole].0 - Finished processing (I=0, O=0, R=7, W=0, U=0, E=0)

      2020/08/28 01:16:02 - LDAP input.0 - Disconnected from server

      2020/08/28 01:16:02 - LDAP input.0 - Finished processing (I=12, O=0, R=0, W=12, U=0, E=0)

      2020/08/28 01:16:02 - TransferLDAPInfo - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Errors detected!

      2020/08/28 01:16:02 - Spoon - The transformation has finished!!

      2020/08/28 01:16:02 - TransferLDAPInfo - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Errors detected!

      2020/08/28 01:16:02 - TransferLDAPInfo - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Errors detected!

       

       

       

      Regards,

      Syed Abu Owais

        • 1. Re: BMC REMEDYFORCE PENTAHO INTEGRATION WITH ACTIVE DIRECTORY
          S. Abu Owais Bin Nasar

          Dynamic account, profile and permission set assignment Script: (as follow)

           

          //Script here

           

          var parsedDate =  new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date());

          var successFileName = getVariable("Internal.Job.Filename.Directory","") + "/" + "LDAP_SUCCESS_ROWS_" + parsedDate;

          var failureFileName = getVariable("Internal.Job.Filename.Directory","") + "/" + "LDAP_FAILURE_ROWS_" + parsedDate;

          var active = true;

          var account = 'Acme'; //This is a sample account please change it with your default account.

          var profile = 'ServiceDesk Client'; // This is a sample profile, change it with your default profile

          var role = 'CEO';

          var mailAddress;

          var Locale = 'en_US';

          var Language = 'en_US';

          var TimeZone = 'America/Los_Angeles';

          var EmailEncoding = 'ISO-8859-1';

          var Alias ='';

          var permissionSet = 'ServiceDesk_Client';// This is a sample permission set change it with your default profile

          var bAssignRemedyforceLic = true;

          var managerName ='';

          var managerNameArray;

           

           

          if(givenName != null && givenName.length > 0)

          {

                 Alias = givenName.charAt(0);

                 if(sn != null  && sn.length > 0)

                 {

                    if(sn.length <= 7)

                    {

                               Alias += sn;

                    }

                    else

                    {

                            Alias += sn.substring(0,7);

                 }

                 }     

          }

          else

          {

                        if(sn != null && sn.length > 0)

                        {     

                               Alias = sn;

                        }

          }

          if(manager != null)

          {

                 var ldapArray = manager.split(',');

                 if (ldapArray)

                    {

                     

                      var managerNameArray = ldapArray[0].split('=');

                        managerName = managerNameArray[1];

                        if (ldapArray.length > 1)

                        {

                          for(index=1; index < ldapArray.length; index++)

                            {

                              var ldapElement= ldapArray[index];

                              if (ldapElement.indexOf('=') == -1)

                              {

                                managerName  += ','+ ldapElement;

                              }

                              else

                              {

                                break;

                              }

                            }

                        }

           

                    }

             

          }

           

          /*

          if(manager != null)

          {

                 var start = manager.indexof('CN=');

                 var end = manager.indexof(',OU=');

                 manager = manager.substring(start, end);

          }*/

           

           

          if(mail == null)

          {

                 if(    userPrincipalName != null)

                 {

                        mailAddress = userPrincipalName;

                 }

          }

          else

          {

                 mailAddress = mail;

          }

           

          //Following script works for microsoft active directory to set the active flag based on the active directory attribute which indicates whether the user is disabled or not

          //Uncomment the following four lines if you want to set the users active or inactive in the salesforce org based on this flag

          /*

          if(parseInt(userAccountControl) & 2)

          {

                 active = false;

          }

           

          */

           

          /*

           

          var ou;

          var cn;

          if(userPrincipalName == "jmeyer@magicdallas.local")

          {

                 account = "Service Support";

                 profile = "Customer Portal Manager";

           

          }

           

          if(ou == "xyz")

          {

                 account = "xyz company";

                 profile = "External Customer";

          }

           

          if( cn == "John Meyers" )

          {

                 account = "BMC";

                 profile = "Service Desk Client";

          }

           

          */

           

          setVariable("LDAPSUCCESSFILENAME",successFileName, "r");

          setVariable("LDAPFAILUREFILENAME",failureFileName, "r");