Impossible to run a scheduled task of PowerCLI on Windows 7

Hello

I try to perform a task of scehduled on Windows 7...

What I tried:

AgConfigVirtual.bat

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe - PSConsoleFile "C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\vimaxx.psc1"-command '& {C:\VMware\AgConfigVirtual.ps1} '.

vimaxx.psc1 (necessary to create another as the other file was giving me an error on the psmodules section, so I removed the in this new file)

<? XML version = "1.0" encoding = "utf-8"? >

< PSConsoleFile ConsoleSchemaVersion = "1.0" >

< > 1.0 PSVersion < / PSVersion >

< PSSnapIns >

< PSSnapIn Name = "VMware.VimAutomation.License" / > "

< PSSnapIn Name = "VMware.DeployAutomation" / > "

< PSSnapIn Name = "VMware.ImageBuilder" / > "

< PSSnapIn Name = "VMware.VimAutomation.Core" / > "

< / PSSnapIns >

< / PSConsoleFile >

AgConfigVirtual.ps1

$pwd = get-Content C:\VMware\powerclicred | ConvertTo-SecureString

$cred = New - Object System.Management.Automation.PSCredential 'user', $pwd

SE connect-VIServer-Server Server1 Server2, serveur3, server4, Server5-Credential $cred

$ESXiServers = get-VMHost | Name sort

$Excel01 = new-Object - ComObject Excel.Application

$Excel01.Visible = $False

$Workbook01 = $Excel01.Workbooks.Open("Z:\Servers\ConfigVirtual.xlsx")

(rest of the script)...

Ok... When I opened a cmd and run beats, it works normally... connection to all servers and then run Excel to do the rest of the script.

When I schedule it, it just does not take into account the part of connection and opens the Excel process...

What I am doing wrong?

PS: The user has permissions to run as a batch process

LucD,

Thanks for your time and your attention =]

I got it to work... There is a bug when opening Excel using PowerShell files scheduled tasks...

All I had to do is create the Desktop folder on the recommended way and work for the task.

Sources:

Excel - Powershell script cannot access a file when it is run as a scheduled task - Stack Overflow

https://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

Thank you once again!

Tags: VMware

Similar Questions

  • services that run via scheduled task

    Hi all

    I am creating a task scheduled to start/stop services. the scheduled task must be run under the service account with minimal rights, as rights of the user or the user rights of maximum power.
    I created the scheduled task running under the account of service with power user rights to stop a service, but unfortunately the task was doing what it suppose to do.
    I did some troubleshooting and investigated as shown below:
    1. I used the runas command to run net stop under the service account that runs the scheduled task, the service is stopped, as it is assumed
    2. I connect to the server using the account service and disconnected (the session will be shown in the disk for the service account) and at the same time open a session to the server with a different account performed the scheduled task, the task does what it is supposed to do. (the service is stopped)
    Note: the scheduled task is set to enabled (scheduled task to run at a specified time)
    3 when I changed the rights on behalf of rights of administrator power user rights service and perform scheduled task, the task runs correctly and does what he must do.
    4. the service was set to be managed by the user with power, which means that if a user opens a session on the server and try to start/stop the service, he will be able to action and is successful.
    my questions will be as shown below:
    1. to start/stop the service via a scheduled task, the service account needs a session to be able to perform the task?
    2 must. the service account the highest privileges to perform the task?
    3. is there a way to avoid to run the scheduled task to run with minimum privileges? What kind of things need to be done.
    Thanks in advance for your answer.

    I would look at the link below.  This should answer all these questions.

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/sag_tsconcepts03.mspx?mfr=true

  • IOM api to run a scheduled task

    Hello

    I use OIM 11.1.2.2.

    I run a scheduled task with the api and a failed idea. I saw this api Thor.API.Operations.tcuserOperationsIntf and that have what I need.

    Can you help me?

    SchedulerService (Oracle Fusion Middleware Java QAnywhere for Oracle Identity Manager), APIs will do it.

    triggerNow

    void triggerNow(java.lang.String jobName) throws SchedulerException, SchedulerAccessDeniedException
    
    Runs the specified job
    Parameters:
    jobName-The work that needs to be triggered
    Throws:
    SchedulerException -when an error occurs in the Quartz engine or Scheduler is not running.
    SchedulerAccessDeniedException -This exception will be thrown if the access permission for the operation is not available for the user

    -Kevin

  • How to run a scheduled task in specific (current) edition

    11.2.0.3

    I use redefinition of the basis for the development of a database. So far, the experiences have been good with it.

    We have three editions: ORA$ BASE = > BETA = > ALPHA

    BETA is the default edition. Development of new packages for this in ALPHA and then copied to the BETA and ORA$ BASE.

    We now want to carry out certain activities of pl/sql running for a long time as a background task.

    However. When we create a job regular db in ALPHA, it will run in the DEFAULT edition (BETA).

    I want to run a scheduled task in the same edition, where it was created from.

    It is a way to run configure a job normal regular db to execute in a specific edition?

    Example/demo

    -- test case run dbms_job as background 
    execute dbms_application_info.set_module('UT10_START_SESSION',null);
    execute dbms_application_info.set_client_info(sys_context('userenv','current_edition_name'));
    
    

    This test of construction scenario helped me narrow down the problem and find a solution.

    I need to perform the task with a dedicated job class. Job classes can add a service_name. The name of service in turn can be connected to a specific edition.

    first prepare the job classes

    ---Run as DBA
    begin
      dbms_scheduler.create_job_class (
       job_class_name => 'JCED_DEV$ALPHA',
       service        => 'ALPHA'
       );
    end;
    /
    
    begin
      dbms_scheduler.create_job_class (
       job_class_name => 'JCED_DEV$BETA',
       service        => 'BETA'
       );
    end;
    /
    
    begin
      dbms_scheduler.create_job_class (
       job_class_name => 'JCED_ORA$BASE',
       service        => 'BASE'
       );
    end;
    /
    
    grant execute any class to targetuserschema;
    

    Service names were already in place (you can use dbms_service to create a service based from version 11.2.0 edition.3).

    -- test case run dbms_job as background
    declare
      v_jobname   varchar2(30) := 'TestEditioning_UT10' ;
      v_starttime timestamp := systimestamp;
    begin
      dbms_scheduler.create_job(job_name            => v_jobname,
                                job_type            => 'PLSQL_BLOCK',
                                job_action          => q'[begin
      dbms_application_info.set_module('UT10_BACKGROUND_SESSION',null);
      dbms_application_info.set_client_info(sys_context('userenv','current_edition_name'));
      dbms_lock.sleep(60);
    end;
    ]',
                                job_class           => 'JCED_'||sys_context('userenv','current_edition_name'),
                                number_of_arguments => 0,
                                start_date          => v_starttime,
                                enabled             => FALSE,
                                auto_drop           => true);
    
      dbms_scheduler.enable(v_jobname);
    end;
    /
    commit;
    

    SID CLIENT_INFO SERVICE_NAME LOGON_TIME ACTION MODULE

    250 UT10_START_SESSION DEV$ ALPHA ALPHA 17.07.14 10:28:32

    251 UT10_BACKGROUND_SESSION DEV$ ALPHA ALPHA 17.07.14 16:23:26

    Success!

  • Permission to create/run the scheduled task

    Hello

    I'm running Windows 7 Pro RTM and I try to use my normal user account to create and run a new scheduled task, but whenever I try to save the task, I get an error msg saying "Task Scheduler cannot create the task.» Does not know the user account, the password is incorrect or the user account doesn't have permission to create this task".

    I have no problems running tasks under my admin account, but I don't want to use it for everyday purposes. I'm also sure that this error must be because of permissions problems, so can I know what is the privilege that a user must have to create/run one account task?

    Thank you very much

    Hi hifer,.

    Please use the forum for answers,

    If your account is a standard account, you will not have permission to create a task or schedule task.  Your account must be an administrator account to schedule the task for the system or it must be run as an administrator.

    It have additional permissions, you can add standard user profile to allow the profile to create the task.  But this option is not available in all versions of Windows and rather complicated.  You can try to add these groups to your profile using computer management in administrative tools.  User with power and Backup administrator can provide you with the authorization that you need if the groups are available with your version of Windows 7.

    Hope this helps,

    Kevin
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to force the display of user account control to run the scheduled task

    I have User Account Control setting on notify me when a program wants to make changes to my computer (the recommended setting).

    I created a scheduled task: create a restore point, using a software called Quick Restore Maker. User accounts in the program control screen comes up and stays on, ends by closes but ends the program. As I'm not at the computer when running task, I can't cancel the screen. The display ends by disappears, but the program itself does not run.

    So the question is: How can I force screen UAC a program to run without changing the UAC universal computer settings that would allow any program to change my computer without any intervention from me?

    Thanks for your help.

    There is no way around the need for approval of Admin indicated by the parameter of the UAC.

    Reduce the level of UAC would be the only thing you can try, but I understand that this would not be a safe way to proceed for normal operation.

  • Need to update a user existing in the IOM by running the scheduled task.

    Hi all

    I configured the GTC connector for flat file with which I am able to create users in the IOM successfully. Here is an example of flat file

    ##hRDB
    UserID, firstname, lastname, Manager, EmployeeType, Org, role, service, location, position
    AWinslet, Aate, Winslet, null, full-time, Xellerate users, end-user, engineering, Mumbai, Software Engineer

    and now, I'm not trying to update service user attribute by changing (financial engineering) Department in a flat as file below.

    ##hRDB
    UserID, firstname, lastname, Manager, EmployeeType, Org, role, service, location, position
    AWinslet, Aate, Winslet, null, full-time, Xellerate users, the end user, finance, Mumbai, Software Engineer

    When I ran a task scheduled for the resource to flat file GTC I get below error.


    WARN, January 5, 2011 23:26:29, 354, [XELLERATE. DCM PROVIDER. RECONCILIATIONTRANSPORT], FILE ARCHIVED successfully: C:\HRFeed\staging\identities 20110105.txt
    ERROR, January 5, 2011 23:26:34, 588, [XELLERATE. SERVER], class/method: tcUSR/verifyUserLogin error: User Loginid is doubled.
    ERROR, January 5, 2011 23:26:34, 744, [XELLERATE. SERVER], class/method: tcUSR/eventPreInsert error: user login is not correct.
    ERROR, January 5, 2011 23:26:34, 760, [XELLERATE. SERVER], class/method: tcDataObj/save error: wrong to save SQL operation
    ERROR, January 5, 2011 23:26:35, 088, [XELLERATE. DATABASE], class/method: tcDataBase/rollbackTransaction some problems: Rollback performed
    java.lang.Exception: Rollback performed

    Errors, that I got to know which scheduled task to the resource of flat file GTC tries to create the new user but not to update existing user. I want to update the attributes of the user for existing users by running the flat file GTC

    Please provide your valuable contributions

    Kind regards
    Madhu

    Check the indicator "Matching" only in the management section BMS. This indicator is as a rule of reconciliation and should be checked for the primary key for example attribute emp number or the connection. Please let me know if the corresponding flag setting is correct in your environment.

  • Running the Scheduler tasks.

    Hello friends,

    How to find currently running tasks scheduled with query!

    --
    Kind regards
    Pradip Patel

    Select * from dba_scheduler_running_jobs;

  • Discoverer privileges to run a scheduled task

    Hello
    Planning a workbook, but when it's time to run, I get the error "not enough priivileges.
    Should what privielges I do?

    Thank you for your help

    Siegwin

    Hello

    It would also be the user doesn't have the required database privileges. For a user who is planning they need these privileges:

    connect
    resources
    analyze a
    Create the procedure
    create sequences
    create session
    create table
    create view
    run a procedure
    global query rewrite
    Select any table
    Unlimited tablespace
    run on sys.dbms_job
    Select on sys.v_$ parameter

    Rod West

  • credentials are not passed to the script that is run as a scheduled task

    I create a new thread since I did not see any action on the existing, where I posted (not sure if anyone saw it because the age of the thread).  For reference, see http://communities.vmware.com/message/1406190.  But the main thing is the execution of a script as a scheduled task is not correctly the credentials of the Windows service account to the cmdlet Connect-VIServer.  When you run this cmdlet, it throws the following error:

    SE connect-VIServer: & lt; SourcePath & gt;\%APPDATA%\VMware\credstore to & lt; SourcePath & gt; \scriptname.ps1:41 tank: 17

    Anyway, the rumor was that it was corrected in PowerCLI 4.0, but this doesn't seem to be the case as Alan Renouf (and now me) have pointed out.  On my original message in this thread...

    My two cents to Rob, Luc and Alan. I had this problem with PowerCLI 4 as well. However, I think it's sort of fixed. Here's my situation:

    (1) I have an account with appropriate permissions vCenter AD service.

    (2) I have run the scheduled task of options with this service AD account while connected to the server and it works of course very well.

    (3) I log off.

    (4) script continues to work fine until the server is restarted (which of course happens every month for Microsoft patches).

    (5) to resolve what I can simply log in with my account service and connect immediately - I have not even interactively run the script to fix.

    So it seems to me that connecting you must create the APPDATA % environment variable and apparently a disconnect is not clear the variable correctly or something.

    My main question, that is why "Connect-VIServer" even trying to make a call to that path? Must not only do that when I call it "Get-VICredentialStoreItem"? My script is done simply:

    [string]$strVCServer = "servername.domain"
    Connect-VIServer -Server $strVCServer

    I'm not trying to save credentials as pass through must work properly and be a bit more secure.

    Hi Allen,.

    Yes, the problem is solved in U1. He is not related to PS 2.

    Kind regards

    -Angel

  • Scheduled task runs does not correctly in the Windows XP machine.

    Original title: Troubleshoot the scheduled task.

    I have a scheduled task scheduled to run at 2:30 every night.  The time of execution scheduled next is 02:30 March 2, 2011.  I was not able to know what prevents it from running.  After a diagnosis, I'm sure it's not the exact command, but rather the setting in the scheduled task.  However, this is just in case: cmd /c start 'scan MalwareBytes' / low/b "C:\Program Malwarebytes ' Anti - Malware\mbam.exe" / scan-complete - log - cancel

    I have read many web pages on the resolution of the scheduled tasks, but the principal that I follow is http://support.microsoft.com/kb/308558.  Here is what I checked:

    • The scheduled task folder shows a 27 February 2011 than last time to run
    • Last log written by the application is February 27, 2011, confirming the last Run Time
    • Status column is empty
    • The application runs if I right click on the scheduled task and select run
    • I used 'cmd' and 'start' in a similar way to successfully launch a low priority job in different scheduled task launching a different application of scanning
    • Application logs for all three of my tasks planned for antimalware scans different show that there is a lot of room between the task durations
    • If I right click on the task failed on demand, choose run and wait for the end, success is indicated by a new log file written by the application and a "Last Run Time" update in the scheduled task folder
    • c:/Windows/SchedLgU.txt confirmed that the scheduled task that failed did not run since February 27, 2011, while other scheduled tasks has been run.  After a right click and running, c:/WINDOWS/SchedLgU.Txt shows a successful run.

    All my regular scans are set to run if the computer is idle, and I'm sure that didn't prevent this idling at this hour there.  The scheduled task failed is set to run under an administrator account even if this user is not signed.  He was placed this way well before the last run time of the February 27, 2011, and other tasks are also implemented this way (with success).  Is there anything else I can try?

    I think I found the problem.  I unchecked the option somehow to wake up in order to perform the scheduled task.  Thank you all for your answers.

  • Exchange Connector - scheduled task, running time

    Hello

    Does anyone have experience with long-term when you run the scheduled task to "Exchange target resource user Reconsiliation" for the first time (full reconsiliation)
    It worked for about an hour now and I don't know if it's fake or not. In the event log, I get a bunch of them:
    oracle.iam.connectors.icfcommon.recon.ReconEvent: putSingleField: attribute [Message body Format *] not found in the connector object.

    * It varies, e.g. [Format Message prefer to use]

    Advice will be appriciated :)

    What version of the connector and what version of OIM? I saw problems with the connector of the ICF and the way in which it is recognised. A few bugs:

    1 14757197-> it is to solve the problem where the Get-DistributionGroup is heated in the connector for all users, even if we had removed the configuration of IOM to make distribution of the user groups. In our environment, it's take more then 2 minutes to get distribution group a user of the.

    2 14759585-> base connector does not any parameter search for the ORGANIZATIONAL unit in the work of the annex, so the way it works is that it picks up all the user defined in the resource base then iterates through each of them to match the filter criteria in the planning work and creates events if the filter matches. That means, is that all users are loaded into the memory of the Server Connector first, and then they are checked for recon rule. This affects the performance in a negative way. A means of circumvention, it is searching for base in resource limited to a specific organizational unit, but if you have several units of organization and an AD forest with multiple domains, you need to create several resources and which may impact your design of the access policy (as applicable). So, we had this fixed bug where work planning would be an additional parameter of the UO there where we want to get the users of. If you have a very high number of users, it may even crash your server connector. This bug also solves the problem where the filter is now supported for exchange attributes (not all good) in the scheduled task. So, you can put a filter to reconcile (or basically interview) for human mailboxes only.

    3 14786992-> this issue got to the mailbox database. The connector works from basic is to run the Get-MailboxDatabase command for each user with no - possibility of identity. What this means is that this command brings
    all the databases in the system and returns the last in the list as the user. Two effects here, performance if the number of databases in our case is huge (80) and second is data incorrect in the IOM. Even if the user has e-mail data in the data store 'A' IOM would show that the data store is "Z".

    I don't remember anymore but searching metalink and you should find one or two more that we have opened.

    -Marie

    Published by: Bikash Bagaria on February 28, 2013 20:00

  • Error when running scheduled task

    Im getting this error when I run a scheduled task to add all users to a group if they are responsible:

    Error when performing the task: Thor.API.Exceptions.tcAPIException: [EJB:010160] security breach: user: '< anonymous >' a insufficient to access the EJB authorization: type = < ejb > application = Xellerate, module is xlDataObjectBeans.jar, ejb = tcGroupOperations, method = addMemberUser, methodInterface = Remote, signature is {long, long}.

    any idea?

    There may be several reasons for this error as if you were creating instance of any operationsintf so many times then it shows this error or how you create an instance of operationsIntf. You'll have to do the following:

    reconciliationOperationsIntf (tcReconciliationOperationsIntf) = getUtility ("Thor.API.Operations.tcReconciliationOperationsIntf");

    And fairer if you see weblogic docs here search you with space of JNDI names. They provided a few steps to remove this error.

  • Problem when running recon research org AD scheduled task

    Hello

    I get errors thrown when you try to run the scheduled task recon AD org search.

    using IOM 9.1.0.1 with the last AD on JBoss connector.

    the error log-

    2009-10-21 16:00:01, 399 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: connectToAvailableAD: COMPLETED
    2009-10-21 16:00:01, 399 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: Disconnect: STARTED
    2009-10-21 16:00:01, 414 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: Disconnect: FINISHED
    2009-10-21 16:00:01, ERROR 430 STDERR Exception in thread "DefaultQuartzScheduler_Worker-7".
    2009-10-21 16:00:01, 461 STDERR ERROR java.lang.NoClassDefFoundError: com/Sun/jndi/ldap/ctl/PagedResultsControl
    2009-10-21 16:00:01, 461 ERROR STDERR-at com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController.searchResultPageEnum (Unknown Source)
    2009-10-21 16:00:01, 461 ERROR STDERR-at com.thortech.xl.schedule.tasks.ADLookupReconTask.performReconciliation (Unknown Source)

    Can someone help me please?

    Thank you

    Hello

    Have placed the ldapbp.jar in the third folded directory of the OIM_Home?
    If not just add and add also in the class path and try it.

    concerning

  • Problem running AD organization search Recon scheduled task

    Hey all,.

    I get errors thrown when you try to run the scheduled task recon AD org research in JBoss.

    Execution of IOM 9.1.0.1 with the last AD connector.

    Here is the error that JBoss throws...

    2009-10-21 16:00:01, 399 DEBUG [OIMCP. A/d converters] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: connectToAvailableAD: COMPLETED
    2009-10-21 16:00:01, 399 DEBUG [OIMCP. A/d converters] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: Disconnect: STARTED
    2009-10-21 16:00:01, 414 DEBUG [OIMCP. A/d converters] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController: Disconnect: FINISHED
    2009-10-21 16:00:01, 430 ERROR [STDERR] Exception in thread "DefaultQuartzScheduler_Worker-7".
    2009-10-21 16:00:01, 461 ERROR [STDERR] java.lang.NoClassDefFoundError: com/Sun/jndi/ldap/ctl/PagedResultsControl
    2009-10-21 16:00:01, 461 ERROR [STDERR] at com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController.searchResultPageEnum (unknown Source)
    2009-10-21 16:00:01, 461 ERROR [STDERR] at com.thortech.xl.schedule.tasks.ADLookupReconTask.performReconciliation (unknown Source)
    2009-10-21 16:00:01, 461 ERROR [STDERR] at com.thortech.xl.schedule.tasks.ADLookupReconTask.execute (unknown Source)
    2009-10-21 16:00:01, 461 ERROR [STDERR] at com.thortech.xl.scheduler.tasks.SchedulerBaseTask.run (unknown Source)
    2009-10-21 16:00:01, 477 ERROR [STDERR] at com.thortech.xl.scheduler.core.quartz.QuartzWrapper$ TaskExecutionAction.run (unknown Source)
    2009-10-21 16:00:01, 477 ERROR [STDERR] at Thor.API.Security.LoginHandler.jbossLoginSession.runAs (unknown Source)
    2009-10-21 16:00:01, 477 ERROR [STDERR] at com.thortech.xl.scheduler.core.quartz.QuartzWrapper.execute (unknown Source)
    2009-10-21 16:00:01, 477 ERROR [STDERR] at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
    2009-10-21 16:00:01, 493 ERROR [STDERR] at org.quartz.simpl.SimpleThreadPool$ WorkerThread.run (SimpleThreadPool.java:520)
    2009-10-21 16:00:01, 493 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: ADP ClassLoader load failure: com.sun.jndi.ldap.ctl.PagedResultsControl
    2009-10-21 16:00:01, 493 ERROR [STDERR] at com.thortech.xl.dataobj.tcADPClassLoader.findClass (unknown Source)
    2009-10-21 16:00:01, 493 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    2009-10-21 16:00:01, 508 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    2009-10-21 16:00:01, 508 ERROR [STDERR] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    2009-10-21 16:00:01, 508 ERROR [STDERR]... 9 more

    I think I have my AD correctly configured connector.
    My field is dc = test-IOM, dc = local

    Any help would be greatly appreciated.

    Thanks in advance.
    -Bryan

    You may need to add the ldapbp.jar in the class path. place it in the lib or lib ext directory IOM jdk.

    Hope this helps,
    Sam

Maybe you are looking for