Hello -
We have successfully implemented the extremely helpful VMWare Healthcheck script posted here at http://communities.vmware.com/docs/DOC-7430. One baffling problem which we've been having is that
when the script runs as a scheduled task (called out by a batch file) the recipient will receive an email with the report attached, however the content of said report is more or less empty.
When we run this same batch file manually, we are emailed the report and it is fully populated. I understand this seems completely illogical, but could anyone help us to understand why this is happening?
Thanks very much -
Steve
I just replicated your issue:
I ran the script with a user who has no rights to the virtual center server but is an admin on the box:
Heres the result:
03/04/2009 15:58:28
Datastore | UsedGB | FreeGB | PercFree |
---|---|---|---|
0 | 0 |
There may be a problem with permissions on that account.
Remember to back EVERYTHING up before you change ANYTHING
Hi Steve,
Just to get the obvious out of way because someone will ask you if I don't.
Is it running on the same box youi manually ran it on?
Is it using the same account?
Remember to back EVERYTHING up before you change ANYTHING
Yes, script is on same box and account is running same credentials.
Ok,
I just tried this and it worked without any issue - seems very strange :smileyshocked:
When you say "more or less empty"
Are the headings there but no data or some data?
Are you running the scheduled task using a batch file to execute?
Joe
Remember to back EVERYTHING up before you change ANYTHING
I'll copy and paste what we receive in our file attachment - The running theory with the team is that the script must be running however something is amiss with Powershell. To make matters more confusing, when I initialy tested last week using scheduled task, things were working. Then a day or two later, we started getting the following -
03/04/2009 08:56:02
Datastore | UsedGB | FreeGB | PercFree |
---|---|---|---|
0 | 0 |
The script is running alright, but all your get-vm etc seem to be failing.
Try this:
Schedule the task:
Log into the system running the scheduled task as the user running it before it fires.
You should see the command prompt box open and be able to watch the script run.
You may see an error thats points to the problem.
Joe
Remember to back EVERYTHING up before you change ANYTHING
I just replicated your issue:
I ran the script with a user who has no rights to the virtual center server but is an admin on the box:
Heres the result:
03/04/2009 15:58:28
Datastore | UsedGB | FreeGB | PercFree |
---|---|---|---|
0 | 0 |
There may be a problem with permissions on that account.
Remember to back EVERYTHING up before you change ANYTHING
You were absolutely right - We must not have taken the required rights on the remote boxes into consideration when we created the task - and thought strictly of admin rights on the box the VI Toolkit was running on... Thank you VERY much for helping us with this...
Steve
Glad I could help.
Remember to back EVERYTHING up before you change ANYTHING
I have exactly the same issue but trying accounts that has both local admin and Virtual center does not seem to do the trick.
I did however notice that once you set the Scheduled tasks credentials to be the same as the currently logged in user then it worked just fine but never when they differ so it must be some context-related permission problem and all help is appreciated.