Run library ThirdParty in Schedule Task - OIM 11

Hi
I have a custom code to ScheduleTask, in this code, I need import a external library. In java code I declared the import of library
I loaded of the .jar to directory OIM_HOME/server/ThirdParty and I ran the UploadJars.sh to ThirdParthy, option 3, but when run the schedule task is diplayed java.lang.NoClassDefFoundError:
I have to do anymore to run this ThirdParty ?
Tks

You need to go into the Weblogic console, select the server (oim_server1) and then the startup tab. Under the classpath box, put in the full path to your jar file. Restart your application server.
Now your scheduled task will be able to find the jar file.
-Kevin

Similar Messages

  • Script runs exponentially slower as scheduled task

    I have a script that I've run a few times before using Citrix snapins. It runs just fine in the console, generally taking around 20 minutes. When I try to run it as a scheduled task, it never completes.
    The script is as follows:
    $time1 = get-date
    Add-PSSnapIn Citrix.Common.Commands
    Add-PSSnapin Citrix.XenApp.Commands
    $_csv = @()
    $_csv_header = """Date"",""Sessions"",""IdleSessions"",""ForcedDCSEssions"""
    $_csv += $_csv_header
    $count = 0
    $idlesessions = get-xasession -Full | where {$_.browsername -eq "IDM Search" -and $_.state -ne "Listening" -and $_.state -ne "Disconnected" -and $_.SessionName -ne "Console" -and ($_.currenttime - $_.Lastinputtime).minutes -gt 15}
    $sessions = get-xasession -Full | where {$_.browsername -eq "IDM Search" -and $_.state -ne "Listening" -and $_.state -ne "Disconnected" -and $_.SessionName -ne "Console"}
    if ($sessions.count -gt 400)
    foreach($idlesession in $idlesessions){
    stop-xasession -SessionId $idlesession.sessionid -ServerName $idlesession.servername
    $count++
    $sessioncount = $sessions.count
    $idlecount = $idlesessions.count
    $date = get-date
    $_csv += """$date"",""$sessioncount"",""$idlecount"",""$count"""
    $time2 = get-date
    $time3 = $time2 - $time1
    $duration = $time3.TotalMinutes
    $_csv += """$duration"""
    $date = get-date -format 'dd.MM.yyyy.hh.mm'
    $_csv | out-file c:\powershell\logs\ImageDC$date.csv -Encoding ASCII
    The Task Scheduler settings are as follows:
    General tab: It runs with local and domain admin privs whether the user is logged in or not
    Triggers tab: It begins at 7:55 AM every morning, repeating every 30 minutes for 12 hours (enabled is checked)
    Actions tab: Start Program  = %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe      Add arguments = –noninteractive -nologo -noprofile -noexit C:\powershell\ScheduledIDMDisconnect.ps1      start in =  
     c:\powershell
    Conditions tab: Only two things checked are "Start the task only if the computer is on AC power" and "Stop if the computer switches to battery power" (those are the defaults, IIRC)
    Settings tab: "Allow task to be run on demand" is checked. "Stop the task if it runs longer than (4 hours)" is checked. "If the running task does not end when requested, force it to stop" is checked. "If the task is already
    running, then the following rule applies: (Run a new instance in parallel)" is at the bottom.
    Can anyone offer any insight? Thanks!
    [email protected]

    Hi,
    Why the -NonInteractive, -NoLogo, -NoProfile, and -NoExit switches? I generally only use -File to point at the script file.
    You might also need to check 'Run with highest privileges'.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)
    I used all those switches because that's what was "in place" as a standard where I am. I already had "run with highest privileges" checked, but switching to just -file + file location seems to have it running as intended now? I'm
    at least getting log files in the specified directory.
    Thanks!
    [email protected]

  • How to use DB queries inside a schedule task - OIM

    Hello Experts,
    I am trying to create an UDF from a schedule task by directly inserting into table.
    1. Insert a record into Table SDC for the new UDF
    2. Alter table USR for the new UDF (After inserting into SDC)
    When I run the task it inserts a record into SDC table and throws below error when it tries to alter the USR table but same query works in SQL Plus.
    Alter Query -- ALTER TABLE USR ADD (USR_UDF_UID  varchar2(50))
    ERROR,12 Sep 2011 14:04:29,509,[XELLERATE.DATABASE],Class/Method: tcDataBase/writeStatement encounter some problems: Invalid column index
    java.sql.SQLException: Invalid column index
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
    at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:5007)
    at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4997)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setString(OraclePreparedStatementWrapper.java:277)
    at weblogic.jdbc.wrapper.PreparedStatement.setString(PreparedStatement.java:745)
    at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
    at com.thortech.xl.ejb.databeansimpl.tcDataBaseBean.writePreparedStatement(Unknown Source)
    at com.thortech.xl.ejb.beans.tcDataBase_vhi04i_EOImpl.writePreparedStatement(tcDataBase_vhi04i_EOImpl.java:4280)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy59.writePreparedStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBaseClient.writePreparedStatement(Unknown Source)
    at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
    at com.test.TestUtility.createUDF(TestUtility)
    at com.test.TestUtility.execute(TestUtility)
    at com.thortech.xl.scheduler.tasks.SchedulerBaseTask.run(Unknown Source)
    at com.thortech.xl.scheduler.core.quartz.QuartzWrapper$TaskExecutionAction.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
    at com.thortech.xl.scheduler.core.quartz.QuartzWrapper.execute(Unknown Source)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:178)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:477)
    ERROR,12 Sep 2011 14:04:29,569,[XELLERATE.DATABASE],Class/Method: tcDataBaseClient/writePreparedStatement encounter some pr
    com.thortech.xl.orb.dataaccess.tcDataAccessException
    at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.createException(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
    at com.thortech.xl.ejb.databeansimpl.tcDataBaseBean.writePreparedStatement(Unknown Source)
    at com.thortech.xl.ejb.beans.tcDataBase_vhi04i_EOImpl.writePreparedStatement(tcDataBase_vhi04i_EOImpl.java:4280)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy59.writePreparedStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBaseClient.writePreparedStatement(Unknown Source)
    Code:
    String insertQry = "INSERT INTO SDC () VALUES (?,?.,,,,)"
              prepareStmtUtil = new PreparedStatementUtil();
              prepareStmtUtil.setStatement( getDataBase() , insertQry );
              prepareStmtUtil.setString(1, SDC_NAME);
    prepareStmtUtil.executeUpdate();
              int rc = prepareStmtUtil.getRowsUpdated();
              if (rc == 1)
    String alterQry = "ALTER TABLE USR ADD ("+SDC_NAME+" varchar2("+SDC_SQL_LENGTH+"))";
                   prepareStmtUtil.setStatement( getDataBase() , alterQry );
                   prepareStmtUtil.executeUpdate(); --> throws exception here
    Kindly assist me.
    Thanks and Regards
    INIYA

    I am trying to create an UDF from a schedule task by directly inserting into table.This is altering DB schema, not inserting into a table, that are you trying to do. DDL operations are not supported in PrepareStatementUtil. Moreover, I'm almost sure the DDL operations are not allowed for operational db connection.
    Use OIM API (ConfigManager) if you want to manipulate UDF.
    Regards,
    Vladimir

  • How to Deploy the Scheduler Task OIM 11g

    Hi.
    I have deployed the scheduler task in OIM 11g and also I have configured the Scheduler task in OIM Admin Console. The Java Scheduler class was not invoked when I run the Scheduler task.
    I have done the following configuration to develop and deploy the scheduler task in OIM.
    1) Developing the Java Class File.
    package edu.sfsu.oim11g.scheduler;
    import java.util.HashMap;
    import oracle.iam.scheduler.vo.TaskSupport;
    import edu.sfsu.oim11g.logger.SfsuLogger;
    public class SfsuTrustedSourceReconciliation extends TaskSupport {
         //private Logger logger= Logger.getLogger(SfsuTrustedSourceReconciliation.class);
         private SfsuLogger logger= new SfsuLogger("SFSU-LOGGER");
         private String className=this.getClass().getCanonicalName();
         private String methodName="";
         public SfsuTrustedSourceReconciliation() {
              methodName="SfsuTrustedSourceReconciliation";
              debug("SfsuTrustedSourceReconciliation() Called");
         @Override
         public void execute(HashMap arg0) throws Exception {
              // TODO Auto-generated method stub
              methodName="execute";
              debug("SfsuTrustedSourceReconciliation Arguments "+arg0);
         @Override
         public HashMap getAttributes() {
              // TODO Auto-generated method stub
              return null;
         @Override
         public void setAttributes() {
              // TODO Auto-generated method stub
         private void debug(Object message)
              logger.info(className+" : "+methodName+" : "+message);
    2) Custom Scheduler XML File
    This file is located in
    /home/oracle/confg_files/schedulers/db/SfsuTrustedSourceReconciliation.xml
    <scheduledTasks xmlns="http://xmlns.oracle.com/oim/scheduler">
         <task>
         <name>SfsuTrustedSourceReconciliation</name>
              <class>edu.sfsu.oim11g.scheduler.SfsuTrustedSourceReconciliation</class>
              <description>Reconciliation IDSync Data</description>
              <retry>5</retry>
              <parameters>
                   <string-param required="true" encrypted="false" helpText="Source Data Source">Source Resource Data Source Name</string-param>
                   <string-param required="true" encrypted="false" helpText="Config Data Source">Config Resource Data Source Name</string-param>
                   <string-param required="true" encrypted="false" helpText="Reconciliation Type is Full Or Cincremental. Default is Incremental">Reconciliation Type</string-param>
                   <number-param required="true" encrypted="false" helpText="Max Records" >Max Records</number-param>
              </parameters>
         </task>
    </scheduledTasks>
    3) Plugin File Configuration.
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins>
    <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass="edu.sfsu.oim11g.eventhandlers.SfsuPostProcessEventHandler" version="1.0" name="SfsuPostprocessExtension"/>
    </plugins>
    <plugins pluginpoint="oracle.iam.scheduler.vo.TaskSupport">
    <plugin pluginclass="edu.sfsu.oim11g.scheduler.SfsuTrustedSourceReconciliation" version="1.0" name="SfsuTrustedSourceReconciliation"/>
    </plugins>
    </oimplugins>
    The event handler is successfully deployed and working fine without any issue.
    4) making the scheduler jar file.
    5) Making the scheduler zip with the following directory format.
    plugin.xml
    lib/scheduler.jar
    6) Registering the Schedule task and event handler as a Plugin.
    ant -f pluginregistration.xml register
    7) Importing the SfsuTrustedSourceReconciliation.xml file into the MDS.
    7.1) weblogic.properties
    wls_servername=oim_server1
    application_name=oim
    metadata_from_loc=/home/oracle/configfiles/schedulers
    7.2) Running the weblogicImportMetadata.sh file
    It imported the SfsuTrustedSourceReconciliation.xml file into the MDS Schema and it is available in the MDS_PATH table in MDS schema
    Path_Name : SfsuTrustedSourceReconciliation.xml
    PATH_FULL : /db/SfsuTrustedSourceReconciliation.xml
    8) Imported the EventHandlers.xml file into the MDS Schema.
    9) Run the PurgeCache.sh file
    10) Restarted the OIM Server.
    11) Loggin into the OIM Admin Console and Created the Scheduler job based on the SfsuTrustedSourceReconciliation listed in the scheduler.
    12) Run the Scheduler job and log file entries are not logged into the log file. My Log File Configuration
    <log_handler name='sfsu-handler' level='FINEST' class='oracle.core.ojdl.logging.ODLHandlerFactory'>
    <property name='logreader:' value='off'/>
    <property name='path' value='/u01/app/wl-10.3.5.0/Oracle/Middleware/user_projects/domains/oim_domain/servers/oim_server1/logs/sfsu-connector.log'/>
    <property name='format' value='ODL-Text'/>
    <property name='useThreadName' value='true'/>
    <property name='locale' value='en'/>
    <property name='maxFileSize' value='5242880'/>
    <property name='maxLogSize' value='52428800'/>
    <property name='encoding' value='UTF-8'/>
    </log_handler>
    <logger name="SFSU-LOGGER" level="FINEST" useParentHandlers="false">
    <handler name="sfsu-handler"/>
    <handler name="console-handler"/>
    </logger>
    Is there any special configuration Do i need to do invoke my Scheduler Java Class File.
    Help is Greatly Appreciated.

    Seems like you did it all right but just piece which if you can modify and test. The plugin.xml has two artifacts eventhandler and the schduler. Can you try creating separate plugin.xml with one for the scheduler zipped up with /lib/scheduleClass.jar and test it?
    Just deregister everything before trying it and let us know how it goes.
    Also the logger as I see is a custom logger, so it is extending the OOTB Logger? Just put some sysouts in the code and check for those in the server out file to be sure.
    Edited by: bbagaria on Jul 22, 2011 5:15 PM

  • Run Powershell script from Scheduled Task as "NT Authority \ SYSTEM"

    Hello, dear Colleagues.
    Cannot make Powershell script from Scheduled Task as "NT Authority \ System"
    Action: Start a program - 
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "C:\script.ps1"
    The matter is that script is working, moreover if to run Task with Domain Account it works too.
    Checked Run with highest privileges, changed "Configure for" field, tried different arguments (-noprofile, -noexit, -executionpolicy bypass, -command, -file,") - no luck.
    Didn't you try to make it work with SYSTEM account?
    Thanks.

    Hi fapq,
    Try this link task schedulers
    Note
    To identify tasks that run with system permissions, use a verbose query (/query/v). In a verbose query display of a system-run task, the Run As User field has a value of NT AUTHORITY\SYSTEM and
    the Logon Mode field has a value of Background only.
    Naveen Basati

  • Modify  Schedule Task - OIM 11g

    Hello Experts,
    I have created a custom schedule task and deployed it in OIM11g and it works. Now I want to modify the deployed schedule task (add some more scheduled task parameters). How to do that? Can you assist?
    I tried the following but its not happening,
    1.exported the schedule task
    2.modified
    3.Imported
    Thanks and Regards
    INIYA

    835060 wrote:
    Two ways
    1.either create a new job with your attributes,deploy and disable the old one(better if its dev env)
    2.Take the export of your metadata.Modify the attributes and import back the fileI guess he already has tried the 2nd option which is not working and I believe it should not work as well. The time you create a job, it reads your xml and sets the attributes and creates a instance of the task. Thus if you just change the xml it won't reflect in the previously created instance.
    Hence create a new job and delete the previous one.
    HTH,
    BB

  • Example of Scheduled task - OIM

    If you can provide an example of schedule task I would appreciate it very much. It looks like it should be extended from SchedulerBaseTask and implement execute method. Example will be very helpful.
    Thank you for your time

    Here's an example
    How to create a new schedule task from java code

  • Security Violation Error while running schedule task from OIM.

    Hi All,
    I am getting this error while running a custom java schedule task from OIM:
    *Thor.API.Exceptions.tcAPIException [EJB:010160] Security Violation: User '<anonymous>' has insufficient permission to access EJB:*
    type=<ejb>,application=Xellerate,module=xlDataObjectBeans.jar,ejb=tcReconciliationoperations,method=createDeleteReconciliationEvent
    at Thor.API.Operations.tcReconciliationOperationsClient.createDeleteReconciliationEvent(UnKnown Source).
    I got this error as soon as my code start creating Delete Reconciliation Event.
    Note: I have already protected the JNDI Namespace.
    Please provide some pointers.
    Regards,
    Sunny

    Hi Rajiv,
    Check this:
    package com.centrica.iam.scheduletask;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileFilter;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Set;
    import oracle.iam.connectors.common.ConnectorLogger;
    import com.thortech.xl.dataaccess.tcDataSet;
    import com.thortech.xl.dataaccess.tcDataSetException;
    import com.thortech.xl.dataobj.PreparedStatementUtil;
    import com.thortech.xl.orb.dataaccess.tcDataAccessException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import Thor.API.tcResultSet;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcInvalidValueException;
    import Thor.API.Operations.tcLookupOperationsIntf;
    import Thor.API.Operations.tcReconciliationOperationsIntf;
    import Thor.API.Operations.tcSchedulerOperationsIntf;
    public class CustomFlatFile extends SchedulerBaseTask {
         private static tcSchedulerOperationsIntf schedulerIntf;
         private static tcLookupOperationsIntf lookupIntf;
         private static tcReconciliationOperationsIntf reconIntf;
         String sObjectName;
         String LookupName;
         String LookupName2;
         String FileDirectory;
         String FileName;
         String File;
         String delimeter;
         String isDeleteTrue;
         HashMap<String, String> attrMap = new HashMap();
         HashMap<String, String> delMap = new HashMap();
         HashMap<String, String> finalMap = new HashMap();
         ArrayList list = new ArrayList();
         public boolean isReconStopped;
         public CustomFlatFile()
              isReconStopped = false;
         public void init()
              LookupName = getAttribute("Attribute Lookup Name");
              FileDirectory = getAttribute("Directory Path");
              FileName = getAttribute("File Name");
              delimeter = getAttribute("Delimeter");
              sObjectName = getAttribute("Resource Object Name");
              isDeleteTrue = getAttribute("Is Delete Allowed");
         public void execute(){
              try {
                   System.out.println("Start Exceute");
                   //Initiate lookupIntf
                   lookupIntf = (tcLookupOperationsIntf)getUtility("Thor.API.Operations.tcLookupOperationsIntf");
                   reconIntf=(tcReconciliationOperationsIntf)getUtility("Thor.API.Operations.tcReconciliationOperationsIntf");
                   catch (tcAPIException tcapiexception){
                        tcapiexception.printStackTrace();
                        //logger.error(classname, s, tcapiexception.toString());
                        //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
                   catch (Exception excep){
                        excep.printStackTrace();
                        //logger.error(classname, s, excep.toString());
                        //logger.setStackTrace(excep, classname, s, excep.getMessage());
                   attrMap = readLookup(LookupName);
                   System.out.println(attrMap.toString());
                   readFile();
                   if (isDeleteTrue.equalsIgnoreCase("true"))
                        performDelete();
                   System.out.println("Finish Execute");
         public void performDelete()
              System.out.println("Start Perform delete");
              int k = list.size();
              System.out.println("list size " + list.size());
              try
                   Thread.sleep(15000);
         /*     Hashtable ahashtable[] = new Hashtable[k];
              Hashtable hashtable = new Hashtable();
              for (int i=0;i<k;i++)
                   hashtable.put("User Id", list.get(i));
                   ahashtable[i] = hashtable;
                   System.out.println(list.get(i));
              Set set = reconIntf.provideDeletionDetectionData(sObjectName, ahashtable);
              System.out.println("Set--" + set.toString());
              tcResultSet tcresultset = reconIntf.getMissingAccounts(sObjectName, set);
              System.out.println("tcresultset - " + tcresultset.getRowCount());
              if (!(tcresultset.isEmpty()))
                   long l[] = reconIntf.deleteDetectedAccounts(tcresultset);
                   for (int i1=0;i1<l.length;i1++)
                        System.out.println("delete recon key " + l[i1]);
              //Get the existing list of Managed users
                   tcDataSet tcdataset = new tcDataSet();
                   tcDataSet tcdataset1 = new tcDataSet();
                   String query = "select orf.orf_fieldname,prf.prf_columnname, sdk.sdk_name from orf, sdk, pkg, tos, prf, obj " +
                             "where pkg.obj_key = obj.obj_key and pkg.pkg_key = tos.pkg_key and tos.sdk_key is not null " +
                             "and tos.sdk_key=sdk.sdk_key and tos.tos_key=prf.tos_key and prf.prf_iskey='1' and prf.orf_key=orf.orf_key " +
                             "and orf.orf_parent_orf_key is null and obj.obj_name='" + sObjectName + "'";
                   tcdataset.setQuery(getDataBase(), query);
                   tcdataset.executeQuery();
                   String FFName = tcdataset.getString("prf_columnname");
                   String FName = tcdataset.getString("sdk_name");
                   String ROFName = tcdataset.getString("orf_fieldname");
                   System.out.println("form- " + FName + " Field- " + FFName);
                   query = "select " + FFName + " from " + FName + " udtable, oiu a, ost b " +
                             "where udtable.orc_key=a.orc_key and a.ost_key=b.ost_key and b.ost_status!='Revoked'";
                   System.out.println(query);
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   int i = tcdataset1.getRowCount();
                   ArrayList list1 = new ArrayList();
                   String s1 = null;
                   System.out.println("N. of rows--" + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   //Getting the existing list of unmanaged users
                   query = "select distinct (b.rcd_value) from rce a, rcd b, orf c, obj d where a.rce_key=b.rce_key and " +
                             "b.orf_key=c.orf_key and c.orf_fieldname='" + ROFName + "' and a.rce_status!='Event Linked' " +
                                       "and a.obj_key = d.obj_key and d.obj_name='" + sObjectName + "'";
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   i = tcdataset1.getRowCount();
                   System.out.println("No. Of Unmanaged Users " + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   int k1 = list1.size();
                   System.out.println("list1 size--" + k1);
                   for (int j1=0;j1<k1;j1++)
                        delMap.clear();
                        delMap.put(ROFName, (String)list1.get(j1));
                        System.out.println(delMap.toString());
                        long l = reconIntf.createDeleteReconciliationEvent(sObjectName, delMap);
                        System.out.println("delete recon key--- " + l);
              catch (Exception exception)
                   exception.printStackTrace();
         public void readFile(){
              String s = "readFile()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              File = getFile();
              BufferedReader reader = new BufferedReader(new FileReader(new
                        File(File)));
              String line = "";
              int k = attrMap.size();
              String value[] = new String[k];
              String Header[]= new String[k];
              if (delimeter.equalsIgnoreCase("|"))
                   delimeter = "\\" + delimeter;
                   line = reader.readLine();
                   Header = line.split(delimeter);
                   while((line = reader.readLine()) != null)
                        value = line.split(delimeter);
                        k = value.length;
                        for (int i = 0;i<k;i++){
                             finalMap.put(attrMap.get(Header), value[i]);
                        System.out.println(finalMap.toString());
                        System.out.println("Start Ignoring Event");
                        if (!(reconIntf.ignoreEvent(sObjectName, finalMap)))
                             System.out.println("Not Ignored");
                        long l1 = reconIntf.createReconciliationEvent(sObjectName, finalMap, true);
                        System.out.println("Recon Key--" + l1);
                        else
                             System.out.println("ignore event ---" + finalMap.toString());
                        list.add(finalMap.get("User Id"));
                        System.out.println(list.size() + "add--" +finalMap.get("User Id") );
                        finalMap.clear();
              catch (Exception exception)
                   exception.printStackTrace();
         public boolean stop(){
              String s = "stop()";
              //logger.setMethodStartLog(classname, s);
              //logger.info(classname, s, "Stopping Reconciliation........");
              isReconStopped = true;
              //logger.setMethodFinishLog(classname, s);
              return true;
         FileFilter fileFilter = new FileFilter()
         public boolean accept(File file)
         String sFilePath = file.getName();
         if( sFilePath.startsWith(FileName) )
         return true;
         else
         return false;
         public String getFile() throws FileNotFoundException, Exception{
              String s = "getFile()";
              //logger.setMethodStartLog(classname, s);
              String s1;
              File dir =     new File(FileDirectory);
              File[] files = dir.listFiles(fileFilter);
              if (files.length ==0)
                   throw new FileNotFoundException();
              if (files.length>1)
                   throw new Exception("Multiple Matches found for this file name");
              s1 = files[0].toString();
              //logger.setMethodFinishLog(classname, s);
              return s1;
         public HashMap readLookup(String s1){
              String s = "readLookup()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              tcResultSet tc1=     lookupIntf.getLookupValues(s1);
              int i = tc1.getRowCount();
              for (int j = 0;j<i;j++){
                   tc1.goToRow(j);
                   map.put(tc1.getStringValue("Lookup Definition.Lookup Code Information.Code Key"), tc1.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
              catch (tcAPIException tcapiexception){
                   tcapiexception.printStackTrace();
                   //logger.error(classname, s, tcapiexception.toString());
                   //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
              catch (Exception excep){
                   excep.printStackTrace();
                   //logger.error(classname, s, excep.toString());
                   //logger.setStackTrace(excep, classname, s, excep.getMessage());
              return map;

  • Scheduled tasks run fine at first then stop running

    This has been an ongoing issue with every Server 2012 machine that we have running tasks (a buddy of mine has the same issue with 2008 R2).  At first the task will run fine as it should but then out of the blue it will simply stop running.  The
    last run time could be months ago and the next run time will be the normal scheduled time to run.  Last run result is always 0x0.  There is also nothing in the history tab as I assume it's been too long ago since the last time it ran.
    I can't figure out what's keeping these tasks from properly triggering and running.  Now before anyone starts going down a list of settings I should check that I might have goofed up, remember, these run fine at first and which jobs stop running properly
    are completely random.  Also, some of these tasks are Microsoft generated tasks like Windows Backup:
    This happens on MS tasks as well as my own tasks that run fine at first but then just stop.  The only fix on a per task basis that I've been able to come up with is to delete the job and create it from scratch where it will then work forever or get
    stuck.  It's completely random.
    I would greatly appreciate any help on this matter as it's driving me absolutely nuts.

    Hi,
    In order to solve the problem more efficiently I need to clarify some information.
    Are there any errors about the scheduled tasks?
    Here are some links below that could be helpful to you:
    Troubleshooting Task Scheduler
    http://technet.microsoft.com/en-us/library/cc721846.aspx
    Scheduled task not running on Windows Server 2008 but working on Windows XP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/46a867a0-8432-4b90-abe3-9a5661d1b276/scheduled-task-not-running-on-windows-server-2008-but-working-on-windows-xp
    Task Scheduler did not run on the planned time. (Windows Server 2008 SP2)
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/d817535a-0210-47e9-a0fe-3c6dbf38b777/task-scheduler-did-not-run-on-the-planned-time-windows-server-2008-sp2
    scheduled task not work good on windows server 2008
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/f7baffb3-be5e-4d2d-953d-160e258089e9/scheduled-task-not-work-good-on-windows-server-2008
    Use the Windows Server 2012 Essentials Log Collector
    http://technet.microsoft.com/en-us/library/jj206706.aspx
    Best Regards,
    Amy Wang

  • I'm trying to run a scheduled task as system, but it will not run my powershell script

    I have a powershell script I created that uses credentials within the script to connect to a network resource to copy files every night. It works fine if I just run the script manually. but I need to run this as a scheduled task, preferably as system. I
    have checked "run with highest privileges" still no luck. 
    If I change the user to my account it works fine, but I need it to work without the use of my account. Is this some kind of security policy problem or what would cause this? I figure having the credentials within the script would work, but not so much.
    Paul Arbogast

    I have a powershell script I created that uses credentials within the script to connect to a network resource to copy files every night. It works fine if I just run the script manually. but I need to run this as a scheduled task, preferably as system. I
    have checked "run with highest privileges" still no luck. 
    If I change the user to my account it works fine, but I need it to work without the use of my account. Is this some kind of security policy problem or what would cause this? I figure having the credentials within the script would work, but not so much.
    Paul Arbogast
    Is the Execution Policy set for the script?
    With this information it sounds to be.....
    Take a look @
    http://technet.microsoft.com/en-us/library/ee176961.aspx
    Best Wishes,

  • Opening Excel Workbook Fails when run from Scheduled Task on Windows Server 2008 Rw

    Hi,
    I have a little vbs script that instantiates the Excel.Application object and then opens a work book to perform some tasks on it. The script runs fine when run from the command line. When I attempt to run it as a scheduled task (it is supposed to update
    data that is pulled from a SQL Server at regular intervals), it fails with the following error:
    Microsoft Office Excel cannot access the file 'c:\test\SampleWorkbook.xlsm'. There are several possible reasons: .....
    The file does exist. The path reported in the error is correct. The account under which the task is running is the same account I use to run it from the command line. User Account Control is not enabled, and the task is set up to run with highest privileges.
    When I run the same script through the Task Scheduler from a Windows Server 2003 machine, it works without issue.
    I was just wondering if somebody on this forum has run into a similar issue in connection with Windows Server 2008 R2 and figured out what the magic trick is to make it work. I'm sure it is rights related, but I haven't quite figured out what which rights
    are missing.
    Thanks in advance for any advice you may have.

    This is truly killing me ... trying to get it working on Windows Server 2012 without success.
    I desperately need to automate running Excel macros in a "headless" environment, that is non-interactive, non-GUI, etc.
    I can get it to work using Excel.Application COM, either via VBScript or Powershell, successfully on many other Windows systems  in our environment - Windows Server 2008 R2, Windows 7 (32-bit), etc.,  -BUT-
    The two servers we built out for running our automation process are Windows Server 2012 (SE) - and it just refuses to run on the 2012 servers - it gives the messages below from VBScript and PowerShell, respectively- 
    I have tried uninstalling and re-installing several different versions of Microsoft Excel (2007 Standard, 2010 Standard, 2010 Professional Plus, 32-bit vs. 64-bit, etc.), but it makes no difference.
    Would be extremely grateful if any one out there has had any success in running Excel automation on Server 2012 in a non-interactive environment that they could share.
    ( I have tried adding the "%windir%\syswow64\config\systemprofile\desktop"
    folder, which did fix the issue for me when testing on Windows Server 2008 R2, but sadly did not resolve it on Windows Server 2012 )
    [VBScript error msg]
    Z:\TestExcelMacro.vbs(35, 1) Microsoft Office Excel: Microsoft Office Excel cannot
    access the file 'Z:\TestExcelMacro.xlsm'. There are several possible reasons:
    • The file name or path does not exist.
    • The file is being used by another program.
    • The workbook you are trying to save has the same name as a currently open work
    [Powershell error msg]
    Exception calling "Add" with "0" argument(s): "Microsoft Office Excel cannot open or save any more documents because th
    ere is not enough available memory or disk space.
     To make more memory available, close workbooks or programs you no longer need.
     To free disk space, delete files you no longer need from the disk you are saving to."
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ComMethodTargetInvocation
    You cannot call a method on a null-valued expression.
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

  • How to handle timestamp in custom scheduled task written for Target Recon

    Hi,
    I have wriiten a Custom scheduled task to reconciile users from target system..but whenever I run the Target Recon Scheduled task .. it generates the Recon. events for all users.
    How to handle this.. how to pass Timestamp value to custom Target Recon scheduled task.
    Thanks,
    Pallavi

    To add to Kevin's point -
    You will have to have a attribute either in the IT Resource or the Schedule Task. At the begining of the reconciliation searches, get the timestamp of the target system and store it in a variable. Fectch the timestamp attribute value from the IT Resource/Schedule Task and use that value as one of the search criteria of user profiles on the target.
    Once all the user profiles from the target are queried and reconciliation is completed then update either the IT Resource or Schedule Task attribute using OIM API.
    Hope this helps :)

  • Exchange 2010 GAL Export script working from EMS but not as a scheduled task

    I have been asked to get a script together to export the GAL on an Exchange 2010 server and then email it to a manager. I have been playing it with days, and have pruned it to the very minimum to at least try and get it working before improving it. At the
    moment I have the text as below:
    Del c:\GALexport.csv
    Get-Recipient -ResultSize unlimited | where {$_.HiddenFromAddressListsEnabled -eq $false} | Select DisplayName,PrimarySMTPAddress,sAMAccountName,alias | Export-Csv "c:\GALexport.csv"
    This works just fine in Exchange Management Shell and deletes the previous report before creating a new one. However, when I set it up as a scheulded task, it does nothing.
    The task is set up as follows:
    Action - Start a Program
    Program/ Script C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe
    Add arguments -version 2.0 -NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; d:\Scripts\GalExportReport.ps1"
    This is set to run under my administrator account with the highest privileges and I have the logon as batch right.
    Unfortunately, when I run it as a scheduled task, nothing happens. The last run result is (0x0) and in the history it says 'task completed', but no report is produced. Can anyone advise please?

    Does it delete the c:\GALexport.csv file? If not, then its not even executing the ps1 script...
    - Open cmd prompt and run below command to confirm that there isn't any typo or any other small error...
    C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version
    2.0 -NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; d:\Scripts\GalExportReport.ps1"
    - If above works then something wrong with task scheduler configuration...
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • Alternatives to PowerShell automation of Excel (Scheduled Task) in a Windows Server 2012 R2 world

    I have a handful of PowerShell scripts that ran as Scheduled Tasks on an old Windows 2008 SP2 server, which output reports as Excel workbooks with multiple worksheets, via a COM object. After migrating these scripts to a new Windows 2012 R2 server,
    these scripts no longer function. The Server 2008 system was running Office 2007, and the new Server 2012 R2 server has Office 2013 installed.
    What is everyone using on their Server 2012 R2 systems to automate generation of multi-sheet reports in Excel via PowerShell and Scheduled Tasks?
    I know that Microsoft has said that automating Office applications server-side in non-interactive mode, but it has worked in the past, until now. (https://support.microsoft.com/kb/257757)
    I've tried the OpenXML PowerTools for PowerShell (https://powertools.codeplex.com/), but Export-OpenXMLSpreadsheet will only export a single worksheet, and they don't support adding worksheets to existing files
    (am I missing something?). I understand the OpenXML PowerTools can be extended in C#, but I don't C#. The PowerShell cmdlets were released in Jan 2012, but don't look to have been updated since then (updates have been the core C# code).
    I've seen recommendations to add C:\Windows\(System32 or SysWOW64)\config\systemprofile\Desktop, but this hasn't worked on Server 2012.
    Has anyone been able to get Excel 2013 to cooperate on Server 2012 R2, or come up with a suitable alternative? I'd rather not start running these scripts from my workstation.
    EDIT:
    I'm not necessarily looking for an Excel answer, since there are OpenXML ways of doing things now without the Excel application.
    Here are some of the errors I'm getting when approaching this from different directions. When I use:
    $excel = New-Object -comobject Excel.Application$workbook = $excel.Workbooks.Add()
    Results in error:
    Exception calling "Add" with "0" argument(s): "Microsoft Excel cannot open or
    save any more documents because there is not enough available memory or disk
    space.
    • To make more memory available, close workbooks or programs you no longer
    need.
    • To free disk space, delete files you no longer need from the disk you are
    saving to."
    At C:\path\to\script.ps1:21 char:2
    + $workbook = $excel.Workbooks.Add()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
    The server is definitely not lacking for resources.
    I can copy a blank XLSX file and use .Open($xlFile) instead of .Add(), but then when I go to open a CSV file to copy/paste the content to a worksheet, I get this one:
    Exception calling "Open" with "1" argument(s): "The server threw an exception.
    (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
    At C:\path\to\script.ps1:65 char:2
    + $tempcsv = $excel.Workbooks.Open($CSVFile)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
    Things that I've tried so far, with no success:
    I created C:\Windows\System32\config\systemprofile\Desktop and C:\Windows\SysWOW64\config\systemprofile\Desktop as suggested here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/0751119d-84d5-4a77-8240-1c4802f97375/powershell-scheduled-tasks-wont-start-excel?forum=winserverpowershell
    Add Local Launch and Local Activation permissions to the Microsoft Excel Application DCOM Config, Grant "Read & Execute, List folder contents, Read" permissions on the \config\systemprofile\Desktop folder. Grant "Modify, Read & Execute,
    List Folder Content, Read, Write" permissions for the account on the following folders:
    \config\systemprofile\AppData\Roaming\Microsoft
    \config\systemprofile\AppData\Local\Microsoft
    as suggested here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/aede572b-4c1f-4729-bc9d-899fed5fad02/run-powershell-script-as-scheduled-task-that-uses-excel-com-object?forum=winserverpowershell
    @ jrv - I will try posting a similar question in the Excel 2013 forum, but since I'm looking for a scripting solution to produce an OpenXML spreadsheet, and not something that necessarily uses the Excel application (though such a solution would not be turned
    away), I thought this the more appropriate venue.
    (to reiterate from OP) I have seen and acknowledge Microsoft's statements regarding the unsupported nature of automating Office applications in non-interactive environments, but the truth of the matter is, supported or not, it worked in the past (Server
    2008), it's what I inherited from my predecessor, and I know I'm not the only one who has been using Excel in this way. I'm only asking fellow scripters, some of whom must also be using Excel in this "unsupported" fashion, how they are automating
    creation of their spreadsheet reports after moving to Server 2012. A different system modification to make the Excel comObject continue working as before? Direct manipulation of the OpenXML document? Other solutions that may or may not require launching the
    Excel application?

    #1 - Ask in Excel 2013 forum.
    #2 - Microsoft has repeatedlynoted that this is NOT a supported configuration for Office products.
    #3 - What errors are you getting?
    #4 - What have you done to debug this:
    #5 - No one can be of much help unless you post a very simple example of how this fails.
    ¯\_(ツ)_/¯

  • CF 9 Upgrade process Ran All Scheduled Tasks

    I just completed the upgrade process from CF8 Enterprise to CF9 Enterprise on our test system, Windows 2003 R2P2 using IIS6 and SQL Server 2000.  I have no schedule tasks with an active schedule, but the upgrade process ran all of the tasks.  Running all of the scheduled tasks created 200+ e-mails.
    Any ideas on what happened?  I ran the coldfusion_9_wwe_win.exe and installed the CF9 ODBC and CF9 SOIR services.
    If this happened on my TEST system (with no actively scheduled tasks) what's going to happen when I upgrade my production system?
    Thanks in advance for your time.
    Libby

    I can't answer your specific question (*), but I would seriously reconsider your approach of UPGRADING a CF server.  Set up CF9 in parallel, and migrate the application/website across to it.
    If you do an inline upgrade and it fails: you've got nothing to fall back on.  If you to a "cross-grade", your working CF8 instance is still there as a fail-over, if anything goes wrong with the CF9 install.
    Adam
    (*) you might want to raise a bug report, though.

Maybe you are looking for

  • Safari CRASH

    My Safari crashes with the following crash report. Any help would be strongly appreciated: Process: Safari [239] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier: Safari Version: ??? (???) Code Type: X86-64 (Native) Parent Process: sh

  • Creating purchase requisitions instead of planned orders after MRP run in MDBT

    When running regenerative planning in MDBT for plant with following details ,The system has to provides planned orders for the materials . Processing key:NEUPL Create Purchase requisition :3 Schedule lines:3 Create MRP list:1 Planning Mode:1 Scheduli

  • Upgrading Hardrive/ Re-installing Snow Leopard Macbook Air

    I just bought a bigger hard drive for my macbook air. I already backed up with time machine. My plan was to install the new hard drive, install snow leopard, and then do a time machine restore. My problem is I own the snow leopard disk but the macboo

  • How to configure the JMS application in WSAD 5.0

    hi i need to configure an JMS application in WSAD 5, but while configuring the application i am checked with intial context exception. but i have configured the jndi in the server. but i cant able to run the application. can anybody help me like how

  • Change RAW to JPEG on Card

    Hi youall, I want to get thumbnails from my compact card inserted in the printer but I do most my pictures in RAW and the printer doesn't recognize a card with RAW pictures on it. I would be uploading first to my computer in order to keep the origina