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
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.
VMware VirtualCenter server name
$vcserver="hostnameofvc"
Add VI-toolkit
Add-PSsnapin VMware.VimAutomation.Core
Initialize-VIToolkitEnvironment.ps1
Connect to VC
connect-VIServer $vcserver -User vcrouser -Password password
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
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
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
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.
VMware VirtualCenter server name
$vcserver="hostnameofvc"
Add VI-toolkit
Add-PSsnapin VMware.VimAutomation.Core
Initialize-VIToolkitEnvironment.ps1
Connect to VC
connect-VIServer $vcserver -User vcrouser -Password password