Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vCheck for Vmware scheduling with task scheduler in windows 2016 #711

Open
rachappachalmi opened this issue May 5, 2020 · 3 comments
Open

Comments

@rachappachalmi
Copy link

rachappachalmi commented May 5, 2020

Hi Experts,

need your help....

I am able to run the vCheck script manually and i get the report but not able to schedule in windows scheduler, below are parameter I configured with task scheduler.

Action : Start a program
Program/Script : C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
Add argument : ExecutionPolicy Bypass -File “E:\Rachappa\OMSR_A1_App\Test\vCheck-vSphere-master\vCheck.ps1"

Can somebody help me configure this vCheck with task scheduler or batch file ?

@lucdekens
Copy link
Collaborator

Since you also cross-posted this in the VMTN PowerCLI Community, I know the issue was primarily due to a lack of documentation.

I'll try to add this to the documentation for v7 and include an example.

@selimatmaca
Copy link

figure this vCheck with task scheduler or batch file ?

I have exact same problem.

@selimatmaca
Copy link

selimatmaca commented Oct 22, 2021

I solved the problem with a batch file. Here's what I have done:
Created a batch file named "Start-vCheck.bat". In this file I have the following commands:
cd "%~dp0"
start powershell -noexit -Command "cd 'C:\vCheck'"
start powerShell -NoExit -Command ".\vCheck.ps1"

In task scheduler:
I used a service account (this user does not exists on vcenter, my vcenter is not ad integrated)
Task runs with highest priviledge of course
In Action Page:
Program/Script: C:\vCheck\Start-vCheck.bat
Start in (optional): C:\vCheck (it says optional but if I dont enter the path it does not work)

If someone needs, try the way I did, it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants