PowerCLI

 View Only
  • 1.  Creating Scheduled Tasks

    Posted Jul 26, 2012 09:05 AM

    Is there any way to create scheduled tasks in vCenter server through a PowerCLI script ...?

    Thanks in advance.

    -- Georgey



  • 2.  RE: Creating Scheduled Tasks

    Posted Jul 26, 2012 09:09 AM

    There are currently no PowerCLI cmdlets to create scheduled tasks in vCenter.

    You can do it through the SDK API, see struggling with scheduled task creation

    But the possibilities are limited to what you can schedule through the vSphere client.



  • 3.  RE: Creating Scheduled Tasks

    Posted Jul 30, 2012 05:17 AM

    Thanks  Luc.

    The pointer was indeed of great help.



  • 4.  RE: Creating Scheduled Tasks

    Posted Aug 07, 2012 11:49 AM

    We have some auditing we do to check if any VM "isolation" settings have changed.

    I have a script that checks all VMs (and exports that as a .html file), but i don't want to log into PowerGUI every week and run it.

    I don't want to log into the VCenter server and run it either. I want the script to run on it's own, weekly.

    I don't want to create a script that connects to the VCenter that has to include a username and password.

    I also don't want to make any ALARMS to do this.

    So, I guess the only way is to create a Windows Scheduled Tasks on the VCenter server, and point it to the script?

    Will it run without credentials?



  • 5.  RE: Creating Scheduled Tasks

    Posted Jul 26, 2012 09:12 AM

    You can call your powershell script from the task scheduler as usual.

    From the task scheduler you have to specify "start a Program" action with following configuration:

    Porgram/script=powershell.exe

    Add arguments (optional): the path to your script

    In your script, to use PowerCLI cmdlets make sure to add the required snapin vmware.vimautomation.core

    Regards,

    Emiliano



  • 6.  RE: Creating Scheduled Tasks

    Posted Jul 26, 2012 12:45 PM

    What kind of scheduled task you want to create? What does it have to do , this task ?

    Greg



  • 7.  RE: Creating Scheduled Tasks

    Posted Jul 30, 2012 05:09 AM

    Grzegorz wrote:

    What kind of scheduled task you want to create? What does it have to do , this task ?

    Greg

    Just the default tasks that are available in  "vCenter Server: Home>Management>Scheduled Tasks"

    - Georgey