Creating Windows Basic Task using powershell

Hello Everyone,
Please help me out in the below situation:
I have to create a basic windows task using powershell to run a script on a specific date and time.
Let me make it even clear :
I have a csv say,
D:\xyz.csv
ServerName ,  Date  , Time
Random1,   11/15/2014,01:00:00PM
Random2,   12/01/2015,03:00:00PM
...and so on
I also have a script at E:\TestingServer.ps1
I need to create list of windows tasks to invoke TestingServer.ps1 with parameters as servername and Time of task as given date and time in csv.
Task1- with input as ServerName at Date and time from CSV
Task2-with input as ServerName at Date and time from CSV

Well here is a good article showing howto do this:
http://blogs.technet.com/b/heyscriptingguy/archive/2012/09/18/create-a-powershell-scheduled-job.aspx
¯\_(ツ)_/¯

Similar Messages

  • Creating a Scheduled Task using PowerShell v4

    So here is my question.  I'm trying/wanting to create a scheduled task using PowerShell v4 on Server 2012R2.  I want to task to run on the 1st day of every month.  The parameter for -Monthly -Day is not available.  I need to use PowerShell
    to create the Scheduled Task because the Task will be running with a group Managed Service Account credentials so the Scheduled Task can not be created via the Task Scheduler GUI.
    Thanks in Advance

    Here is a functioning task It can be easily edited in PowerShell or in notepad to alter the timing
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.1" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
    <Author>W8TEST\user01</Author>
    </RegistrationInfo>
    <Triggers>
    <CalendarTrigger>
    <StartBoundary>2014-06-04T21:31:32.0459499</StartBoundary>
    <Enabled>true</Enabled>
    <ScheduleByMonth>
    <DaysOfMonth>
    <Day>1</Day>
    <Day>12</Day>
    <Day>24</Day>
    </DaysOfMonth>
    <Months>
    <January />
    <February />
    <March />
    <April />
    <May />
    <June />
    <July />
    <August /
    <September />
    <October />
    <November />
    <December />
    </Months>
    </ScheduleByMonth>
    </CalendarTrigger>
    </Triggers>
    <Principals>
    <Principal id="Author">
    <RunLevel>LeastPrivilege</RunLevel>
    <UserId>W8TEST\jvierra</UserId>
    <LogonType>InteractiveToken</LogonType>
    </Principal>
    </Principals>
    <Settings>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <IdleSettings>
    <StopOnIdleEnd>true</StopOnIdleEnd>
    <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>notepad.exe</Command>
    <Arguments>test.txt</Arguments>
    <WorkingDirectory>c:\temp</WorkingDirectory>
    </Exec>
    </Actions>
    </Task>
    I have edited and reloaded the XML many, many times.  It works very nicely.
    ¯\_(ツ)_/¯

  • Install Windows server 2012 using powershell

    Hi Folks,
    How to Install Windows server 2012 using powershell.
    Thanks,

    Hi,
    According to your post, my understanding is that you want to install Windows server 2012 via PowerShell.
    Per the previous thread, we could not install Windows server 2012 directly via PowerShell.
    https://social.technet.microsoft.com/Forums/en-US/53f82989-4b9c-4197-9ff1-03e96c852eb7/how-to-install-windows-server-2012-directly-in-vhd-file-using-powershell?forum=winserver8setup
    As this is the forum for SharePoint server on-premise, I’m not familiar with the Windows server, for this issue, I recommend you can post a new question in the forum for Windows server.
    https://social.technet.microsoft.com/Forums/en-US/home?forum=winserver8setup
    More experts will assist you, then you will get more information relation to Windows server.
    Thank you for your understanding and support.
    More reference:
    http://vegibit.com/install-and-configure-windows-server-2012-with-windows-powershell/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to create a context menu using powershell

    Hi 
    i would like to create a context menu for powershell but i am getting an error after powershell menu is created
    "This file does not have a program associated to it. i am using this script . I am trying to create a powershell shortcut on folders."
    also once it gets created i would like to open powershell as admin always
    New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
    Test-Path HKCR:\Directory\shell\Powershell
    New-Item -Path HKCR:\Directory\shell -Name Powershell
    Set-Item -Path HKCR:\Directory\shell\Powershell -Value "Open Powershell Here" 
    New-Item -Path HKCR:\Directory\shell\Powershell\key -Value "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command ""Set-Location -LiteralPath '%L'"""

    You need to put forth the effort to ask a good, clear, and meaningful question.
    As it stands, you seem to have a record of asking nearly unintelligible questions that take a great amount of effort for others to guess what you are asking. This is bad because it wastes everyone's time.
    Read these for some good information on how to ask good questions:
    Posting guidelines
    Handy tips for posting to this forum
    How to ask questions in a technical forum
    Rubber duck problem solving
    How to write a bad forum post
    -- Bill Stewart [Bill_Stewart]

  • Error while reading raw file created in previous task using raw file destination

    I am reading a flat file and creating an raw file using raw file destination.  path of the raw file is in a variable.  now I am reading the raw file using the rawfile source component. I am able to execute if the .raw file is available.  But
    when we deploy into the production the .raw will be created runtime, so the package is getting failed while evualting the variable which hold the path of the variable.  since the .raw is not available i am not able to proceed further. it's in ssis 2008
    r2
    Error at Load Data [Raw File Source [401]]: File "c:\test123.raw" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    Error at Load Data [SSIS.Pipeline]: component "Raw File Source" (401) failed validation and returned error code 0x80004005.
    Error at Load Data [SSIS.Pipeline]: One or more component failed validation.
    Error at Load Data : There were errors during task validation.

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Windows Server Backup Using Powershell

    Hi
    Am using the VSS to backup some directory to shared path. I want to backup again , at the time only backup modified files or new files, not all completely.
    ( differential backup )
    add-pssnapin windows.serverbackup
    $policy = New-WBPolicy
    $fileSpec = New-WBFileSpec -FileSpec D:\old\*.*
    Add-WBFileSpec -Policy $policy -FileSpec $filespec
    $backupLocation = New-WBBackupTarget -NetworkPath \\xxxxx\Shared\
    Add-WBBackupTarget -Policy $policy -Target $backupLocation
    Set-WBVssBackupOptions -Policy $policy -VssCopyBackup
    Start-WBBackup -Policy $policy
    If you have realated to that cmdlet , please share it here.
    Thanks in advance .
    Karpahasundaram M.

    Hi Karpahasundaram,
    If you want to Back Up Modified Files to a Network location, please try to filter the files in a directory with the "lastwritetimeItem" property, then use the cmdlet "Copy-Item" to copy files.
    Get-ChildItem c:\data -Recurse | where {!($_.psiscontainer) -AND $_.lastwritetime -gt (get-date).date} | ForEach {
    Copy-Item -path $_.fullname -destination \\hyperv1\shared\backup}
    Reference from:
    Use PowerShell to Back Up Modified Files to the Network
    If I have any misunderstanding, please let me know.
    Best Regards,
    Anna

  • Creating user in AD using powershell

    Hi,
    How to create ad user in opalis using powershell?

    Hi,
    best will be, you take the "Run .Net Activity" and put your PowerShell Script in there.
    Example Script
    new-aduser $LoginName -GivenName $FirstNameField -Surname $LastnameField -DisplayName $Displayname -UserPrincipalName "$[email protected]" -ChangePasswordAtLogon $true -AccountPassword (ConvertTo-SecureString –AsPlainText “password1password_1” -Force) -Path "OU=$OU,OU=User,OU=Company,DC=domain,DC=com" -Company $Company -Department $Department -enabled $true -EmployeeNumber $EmployeeNumber -Description $EmployeeNumber -EmailAddress $SMTPAdresse -Division $Division
    Seidl Michael | http://www.techguy.at |
    twitter.com/techguyat | facebook.com/techguyat

  • Create Offline Address Book using powershell - PublicFolderDistributionEnabled not found

    We are using the following commands to create a new Offline Address book using powershell. The command New-OfflineAddressBook runs successfully and creates an Offline Address Book. However when we try to set the value of PublicFolderDistributionEnabled property
    using Set-OfflineAddressBook we get the following exception
    Remote Exception: A parameter cannot be found that matches parameter name 'PublicFolderDistributionEnabled'
                try
                    using (Runspace runSpace = OpenRunspace())
                        // Create offline address book command
                        var command = new Command("New-OfflineAddressBook");
                        command.Parameters.Add("Name", name);
                        command.Parameters.Add("AddressLists", addressListName);
                        command.Parameters.Add("VirtualDirectories", OABServer);
                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command)) == false)
                            return false;
                        // Set offline address book command
                        var command1 = new Command("Set-OfflineAddressBook");
                        command1.Parameters.Add("Identity", name);
                        command1.Parameters.Add("PublicFolderDistributionEnabled", publicFolderEnabled);
                        command1.Parameters.Add("Confirm", new SwitchParameter(false));
                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command1)) == false)
                            DeleteOfflineAddressBook(name);
                            return false;
                catch (Exception ex)
                    DeleteOfflineAddressBook(name);
                    throw;

    If your Exchange version is 2013 it supports only the web distribution method.
    Please follow this to create OAB in Exchange2013 
    http://blogs.technet.com/b/exchange/archive/2013/01/14/managing-oab-in-exchange-server-2013.aspx
    Please check this for the details of OAB in Exchange2013
    http://blogs.technet.com/b/exchange/archive/2012/10/26/oab-in-exchange-server-2013.aspx
    If it Exchange2010 please check
    this
    Thanks, MAS
    Please mark as helpful if you find my comment helpful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Creating look up column using powershell.

    I have a Sharepoint list "Studentparent" in my website. I am trying to create a custom list "studentchild" list using powershell code and this studentchild list will be having a look up column getting ID column from "StudentParent"
    list - So the code is 
    #To which site u want to create the list 
    $spWeb=Get-SPWeb -Identity http://XYZ
    #List type or template 
    $spTemplate = $spWeb.ListTemplates["Custom List"]
    #Get all the lists to the listcollection
    $spListCollection=$spWeb.Lists
    #adding the new list to the list collection
    $spListCollection.Add("StudentChild","StudentChild",$spTemplate)
    #get the path of subsite and sitecollecion 
    $path = $spWeb.url.trim()
    #get the list to the list object
    $spList = $spWeb.GetList("$path/Lists/StudentChild")
    $ParentList = $spWeb.Lists.item("StudentParent")
    $spList = $WebObj.Lists["StudentChild"]
    $spList.Fields.AddLookup("ChildLookupField",$ParentList.id,$false)
    $spChildListLookupField = $spList.Fields["ChildLookupField"]
    $spChildListLookupField.LookupField = $ParentList.Fields["ID"]
    $spChildListLookupField.RelationshipDeleteBehavior = [Microsoft.SharePoint.SPRelationshipDeleteBehavior]::Restrict
    $spChildListLookupField.Update()
    $Views = $spList.Views["All Items"]
    $Views.ViewFields.Add("ChildLookupField")
    $Views.Update()
    but when i run this code - I am getting error
    Cannot index into a null array.
    + $spList = $WebObj.Lists["StudentChild"]

    Hi Mahesh,
    The object "$WebObj" is not instantiated in your code. You have already assigned the value to $splist in following line.
    $spList = $spWeb.GetList("$path/Lists/StudentChild")
    and once again you are assigning value
    $spList = $WebObj.Lists["StudentChild"] // redundant and it should be $spWeb.Lists["StudentChild"]
    Please let us know if this fixes your issue.
    Thanks,
    M. Gubendra Raj

  • Error creating groups in SCSM using PowerShell

    Hello Everyone,
    I am trying to create a bunch of groups and queues within SCSM to seperate work items and CIs from different customers. For example, I have started off by entering the console and creating a group called "Company 1" in my groups (found in Library).
    "Company 1" group defines dynamic members of this group by specifying the following query: The "Active Directory" class, if the Users Company field contains value "Company 1" then add to the group.
    I also need to create a Queue containing all work items for "Company 1".
    I can generate a list of all the company's to enter in a csv, and know enough powershell to import it and read the file line by line
    However, I am having trouble creating the objects. My method was:
    #Get the name of the class I want to create an object of and store it in a variable
    $groupClass = Get-SCSMClass -Name "Microsoft.SystemCenter.ConfigItemGroup$"
    #Return the variable stored to ensure this part is working (Debug purposes)
    $groupClass
    #Get the active status of an object and store it in a variable
    $objStatus = Get-SCSMEnumeration -Name System.ConfigItem.ObjectStatusEnum.Active
    #Return the variable stored to ensure this part is working (Debug purposes)
    $objStatus
    #Create the object stored in my class variable and modify the DisplayName and ObjectStatus properties.
    New-SCSMObject -Class $groupClass -PropertyHashtable (@{DisplayName = "Test"; ObjectStatus = $objStatus;}) -Debug -Verbose
    Once I got this code working my idea was to read from csv and loop the creation process. However, I keep getting the error: "Cannot create objects of an abstract class"
    Am I using the incorrect class to create a group? If so, what is the correct class to select? Is there a more efficient method to do this? Any ideas at all please share, thank you in advance :)

    @Aaron
    Sorry for the late response, I went on vacation and just returned. So basically, I ended up making all these groups manually since I could not find a way to automate the discovery rule creation through script.
    I am now trying to create queues for each of these clients, one queue for each type of work item. I'm working with a client list of around 100, so that means creating almost 300 queues. This would be crazy to do manually - So I began working on a script
    to do this.
    This is what I have come up with:
    # Script Written by SirLearnAlot
    # January 2015
    # Revision 2
    # Get required queues categories (classes)
    $incident = Get-SCSMClass -Name "System.WorkItem.Incident$"
    $RMA = Get-SCSMClass -Name "COMPANY.RMA.Class$"
    $MACD = Get-SCSMClass -Name "System.WorkItem.ServiceRequest$"
    # ManagementPack to store queues in (MP Must be created through PS or else will throw error)
    $MP = Get-SCManagementPack -Name "COMPANY.Queues"
    # Import list of customers (names for the queues)
    $content = Get-Content 'C:\Users\portalservice\Desktop\list.txt'
    foreach ($customer in $content){
    New-SCQueue -Verbose -Name "Incident - $customer" -class $incident -ManagementPack $MP -Filter "Customer_List -eq '$customer'";
    New-SCQueue -Verbose -Name "RMA - $customer" -class $RMA -ManagementPack $MP -Filter "Customer_List -eq '$customer'";
    New-SCQueue -Verbose -Name "MACD - $customer" -class $MACD -ManagementPack $MP -Filter "Customer -eq '$customer'"}
    However I kept running into errors.
    I realized I needed to point the Customer_List found in the incident class to the other two classes, so I had to re-author them to add the customer field and point towards the incident MP to retrieve the enum. I did this successfully with Service Requests,
    but am having trouble applying the same concept to my "RMA" class.
    I have tested the code with both Incidents and Service Requests now and can successfully create the queues correctly, but need to fix my RMA class to complete the task.
    I now cannot seal my MP because I keep running into errors (I am sure I made a typo somewhere or am missing some line or something)
    Any help would be appreciated I am getting extremely frustrated!

  • Agent Task using powershell/VSAE

    I'm trying to create an agent powershell task that will accept parameters. I'm creating this within VSAE. I've tried template and non-template but each time the mp is imported I can't get the parameter overrides to appear when launching the task. Is using
    a powershell agent ask and overrideable parameters possible? A vbscript arguments field does seem to show up fine.

    Hi,
    Please refer to the following article about
     powershell  task samples:
    How to create a PowerShell task for OpsMgr using the Authoring Console
    http://www.code4ward.net/main/Blog/tabid/70/EntryId/50/How-to-create-a-PowerShell-task-for-OpsMgr-using-the-Authoring-Console.aspx
    Alex Zhao
    TechNet Community Support

  • Creating Subdomain DNS Entries using Powershell

    Hello There,
    I created a Powershell script to add some SRV records on a AD-Integrated Zone that Works fine.
    The problem is, I created some subdomains (Right-Clicking on the DNS zone and then adding a new Domain) and I cannot create the records on these subdomains using the shell.
    My Script is this one:
    Import-CSV TEST.CSV | ForEach-Object -Process {Add-DnsServerResourceRecord -ZoneName ccr.intranet -A -DomainName $_.Hostname -Ipv4Address $_.IP}
    It´s working really fine. But, when I try to reference the zone as subdomain.ccr.intranet (example), I cannot create the record, because it tells me that the subdomain is not actually a zone.
    Is there any ways to create these records using the Powershell Script? I have more than 300 srv records and, even I need to create then manually, I really doubt that this is the Only way to do that.
    Thanks!

    ... I'm a little confused, sorry.  So, you want to create an SRV record in ipaosb.ccr.intranet such as _sip._tcp.ipaosb.ccr.intranet, but when you specify the zone as ipaosb.ccr.intranet, it tells you no such zone.
    What happens if you try this?
    Add-DnsServerResourceRecord -Srv -ZoneName ccr.intranet -Name _sip._tcp.ipaosb -DomainName as2metrobah.ccr.intranet -Port 5060 -Priority 0 -Weight 0
    Where _sip._tcp.ipaosb would be replaced by $_.hostname, and reflected in the CSV?
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications

  • Create new schedule task using OIM API

    Hello,
    Steps for setting up eclipse :
    1)Create a new JAVA project.
    2)Right click on your newly created JAVA project & select properties.
    3)In Properties window select JavaBuildPath & select libraries tab.
    4)Click on AddExternalJar's button & add jar files from lib,ext folders of OIM client installation.
    5)Click OK.
    CODE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<package oimscheduler;
    import java.util.HashMap;
    import java.util.Hashtable;
    import javax.naming.Context;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcChallengeNotSetException;
    import Thor.API.Exceptions.tcLoginAttemptsExceededException;
    import Thor.API.Exceptions.tcPasswordResetAttemptsExceededException;
    import Thor.API.Exceptions.tcUserAccountDisabledException;
    import Thor.API.Exceptions.tcUserAccountInvalidException;
    import Thor.API.Exceptions.tcUserAlreadyLoggedInException;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import com.thortech.xl.util.config.ConfigurationClient;
    public class Scheduler extends SchedulerBaseTask
         tcUtilityFactory ioUtilityFactory = null;
         @Override
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createConnection();
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createConnection()
              try
                   System.setProperty("XL.HomeDir","D:\\Oracle\\OIM\\xellerate");
                   System.setProperty("java.security.policy","D:\\Oracle\\OIM\\xellerate\\config\\xl.policy");
                   System.setProperty("java.security.auth.login.config","D:\\Oracle\\OIM\\xellerate\\config\\authwl.conf");
                   System.setProperty("java.naming.provider.url","t3://localhost:7001 ");
                   System.out.println("Setting Configurations .....");
                   System.out.println("Starting .....");
                   ConfigurationClient.ComplexSetting config =
                   ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
                   System.out.println("Login...");
                   Hashtable env = config.getAllSettings();
                   env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   env.put("java.naming.provider.url","t3://localhost:7001");
                   ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","abcd1234");
              catch(tcAPIException ae)
                   System.out.println("Error In createConnection:tcAPIException "+ae.toString());
              catch(tcChallengeNotSetException cnse)
                   System.out.println("Error In createConnection:tcChallengeNotSetException "+cnse.toString());
              catch(tcLoginAttemptsExceededException laee)
                   System.out.println("Error In createConnection:tcLoginAttemptsExceededException "+laee.toString());
              catch(tcPasswordResetAttemptsExceededException praee)
                   System.out.println("Error In createConnection:tcPasswordResetAttemptsExceededException "+praee.toString());
    catch(tcUserAccountDisabledException uade)
         System.out.println("Error In createConnection:tcUserAccountDisabledException "+uade.toString());
    catch(tcUserAccountInvalidException uaie)
         System.out.println("Error In createConnection:tcUserAccountInvalidException "+uaie.toString());
    catch(tcUserAlreadyLoggedInException uale)
         System.out.println("Error In createConnection:tcUserAlreadyLoggedInException "+uale.toString());
              catch(Exception e)
                   System.out.println("Error In createConnection:Exception "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH");
                   user.put("Users.First Name","Oracle-SCH");
                   user.put("Users.Middle Name","JAVA-SCH");
                   user.put("Users.Last Name","SUN-SCH");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    After writing above code ,we have to create jar file.
    Steps To Be Follwed In OIM Design Console
    1)Copy jar file in ScheduleTask folder of your OIM server installation.
    2)Expand administration tree & select TaskScheduler.
    3)Create new task & in class name textfield we have to mention package.classname & mention appropriate values in other textfields & execute it.
    4)Check output.

    We need to override 2 methods while extending from SchedulerBaseTask i.e
    init() :- this method is run before execute by the scheduler .
    execute() :- is executed by the scheduler.
    Revised code :-
    package oimscheduler;
    import java.util.HashMap;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    public class Scheduler extends SchedulerBaseTask
         tcUserOperationsIntf moUserUtility = null;
         @Override
         public void init()
              try
                   System.out.println("In Init");
                   moUserUtility = (tcUserOperationsIntf) this.getUtility("Thor.API.Operations.tcUserOperationsIntf");
              catch (tcAPIException e)
                   e.printStackTrace();
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH1");
                   user.put("Users.First Name","Oracle-SCH1");
                   user.put("Users.Middle Name","JAVA-SCH1");
                   user.put("Users.Last Name","SUN-SCH1");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    Edited by: Rahul Shah on Jul 11, 2011 4:16 AM

  • How to create window key without using the trillium option

    Hi,
    I am having some problems when trying to create using the window key generator module in ODI data quality.
    I created a business data parser for cleansing my records. This had to pass thru 4 routines, the transformer, parser, window key generator and the matcher routines. The transformer and parser routines have run properly but they window key generator is asking me to specify the window key.( I created the rules for the window key. Like last 3 consonants of last name and 5 digits of some ID). But this is not getting accepted when i am running it and pops an error message.
    I also do not have the trillium module integrated with ODI as of now.
    Can anyone help me with this problem or anyone has faced the same situation and have tried a work around for it.
    Please let me know.
    Thanks,
    Chapanna

    Hi,
    If you are using file-based installation, you can install as non-root user and create domains as usual. You can use asadmin command available at <AS_INSTALL>/bin to do this.
    ex: ./asadmin create-domain domaindir /tmp/justfortest adminport 4850 --adminuser admin domain_nonroot_test
    Did you face any problem doing this in non-root. Unless you have write permissions in domaindir, you won't be facing any problem.
    Hope this clarifies your question.
    Thanks,
    -Balaji.

  • Best way to Create Shared Folder using Powershell

    Hi
    Does anyone have any recommendations on creating a shared folder using PowerShell? I've used new-item to create a folder, is there a way to share it and give specific name?
    Cheers

    Hi Shane,
    I’m writing to just check in to see if the suggestions
    were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards
    Anna
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • Not able to ssh out from a router

    Hi All: I notices i can't not ssh out to another device from my router. SSH in from my client (putty) works fine. and not access-list attached to vty with out direction. transport output all I found this problem happened on my ASR1002 with "asr1000rp

  • Difference between SGA_MAX_SIZE and SGA_TARGET

    Difference between SGA_MAX_SIZE and SGA_TARGET

  • Need Help with 404 error

    Hello, I have completed the local folder, tesing server, and remote server setup correctly  (i think so). My testing setup and files shown below: My local folder for site shown below: My advanced settings shown below: I have downloaded all the files

  • Macpro is running slow?

    The spinning wheel appears after each click. New hard drive, New Ram, software re-installed. Utlilites repaired. Still running slow. Is there a clean up that can help? Any other solutions?

  • Oracle Client error after Updating from SuSE9.0 Pro to SuSE9.1 Pro

    Hello, I used Oracle Client on a SuSE 9.0 Professional Workstation. Everything worked fine until the Moment I updated to SuSE 9.1 Pofessional. When I now try to start the Enterprise-Manager I get the following message: /opt/oracle/jre/1.1.8/bin/../bi