VMware Cloud Community
sfortuna74
Contributor
Contributor
Jump to solution

Issue Getting Healthcheck Script to Run

Hello All -

I am nearing the point of exasperation and desperation, so I'm hoping that someone here can help... Using the VI Toolkit and Powershell, we have been running the widely-known and used Healthcheck script. However, we can only get it to run if we are logged onto the server. When it runs via the scheduler, we receive the email, however all the fields are empty.

Desperately hoping someone can help - I am at my wits end...

Thank you very very much in advance -

Steve

0 Kudos
1 Solution

Accepted Solutions
bugeyemonster
Enthusiast
Enthusiast
Jump to solution

i do something like this in all my scripts

this is actually a template i use when ever i start a new script

I also created a user called vcrouser that has readonly rights to vc. That way you dont accidently blow your stuff up with a bad script.

this way it does not matter who runs the script or if its scheduled or not. The script itself does the auth as the read only user.

  1. VMware VirtualCenter server name

$vcserver="hostnameofvc"

  1. Add VI-toolkit

Add-PSsnapin VMware.VimAutomation.Core

Initialize-VIToolkitEnvironment.ps1

  1. Connect to VC

connect-VIServer $vcserver -User vcrouser -Password password

View solution in original post

0 Kudos
4 Replies
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Moved to the VI Toolkit forum.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
LucD
Leadership
Leadership
Jump to solution

When you run it interactively are you logged on with the same account as the one you specified for the scheduled task ?

Could you perhaps show how you defined the scheduled task ?

Did you follow the instructions in for creating a scheduled task ?

And you did see Rob's fix for VITK 1.5 in ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
JoeLyons
Enthusiast
Enthusiast
Jump to solution

This has been posted a few times before and Luc is right, it's always the user account thats running the script doesnt have rights to VC.

Joe

Remember to back EVERYTHING up before you change ANYTHING

Remember to back EVERYTHING up before you change ANYTHING and consider awarding points if answers where helpful to you.
0 Kudos
bugeyemonster
Enthusiast
Enthusiast
Jump to solution

i do something like this in all my scripts

this is actually a template i use when ever i start a new script

I also created a user called vcrouser that has readonly rights to vc. That way you dont accidently blow your stuff up with a bad script.

this way it does not matter who runs the script or if its scheduled or not. The script itself does the auth as the read only user.

  1. VMware VirtualCenter server name

$vcserver="hostnameofvc"

  1. Add VI-toolkit

Add-PSsnapin VMware.VimAutomation.Core

Initialize-VIToolkitEnvironment.ps1

  1. Connect to VC

connect-VIServer $vcserver -User vcrouser -Password password

0 Kudos