Are you sure the task is running with the same credentials under the Task Sceduler ?
It could be that the execution policy used for the account under which the task runs in the scheduler is not set correctly.
Or that account can't do SSO to the vCenter.
Perhaps show us a screenshot of the Task Scheduler entry you created.