If you are working from Sam Harris's version of morality, then you are dealing with something more like Ethical Naturalism which is a type of Utilitarianism, but distinct from many other forms of Utilitarianism. Harris contends that there are moral rights and wrongs that can be objectively stated based on the fact that people stating their preferences are stating facts about the world and as such facts can be objectively assessed. Whilst the traditional Utilitarianism of Mill might be concerned with maximising utility via any means, Harris asserts that such means can be deduced by scientific investigation.
Traditional Utilitarianism is not so concerned with the 'intention' of the person as it is with the outcome, so, in your scenarios both of the seemingly moral actions (because of their good intentions), would be morally wrong because of their outcome. This may seem unfair, but the hard Utilitarians take the position that it would be irrational to want any outcome other than the maximal happiness of humanity (or all concious beings) and so to advise (by moral judgement) the taking of any other course would be wrong.
Ethical naturalism differs slightly in taking into account the consequences of the cultivation of virtue. Phillipa Foot argues that virtues are tools that a person can use to cause well-being. As such your scenarios cannot be taken out of context. So in your first example one might say that the world has suffered an immediate reduction in well-being as a consequence of your actions, but in the long term your cultivation of the practice of 'honesty where it seems appropriate' that will have been furthered by this one exercise, may be logically assessed, using facts about people's preferences, to be something which is likely to bring about an increase in welfare overall, and is therefore moral.
The difficultly with such an approach is that of any consequentialist ethic as Anscombe argues, is that one still has the problem of not being able to see all ends. In both of your examples the consequences are somewhat unpredictable, and so one could argue that judging the rightness of a moral choice on the basis of it's long-term consequences (as Foot would have us do), is even more prone to the unforseeability of the consequences as standard utilitarianism. The counter-argument to this for Harris is from evolution (both biological and cultural). We have, he argues, carried out such experiments thousands of times and so we do indeed have a relatively sure knowledge of the long-term consequences of certain virtues, enough to declare some action objectively wrong.
Opponents of Ethical Naturalism (or any consequentialist ethic really) often use scenarios like the ones you've given to illustrate their opposition, but really, if you examine the reality of the situation carefully, the moral wrong often becomes obvious. Is the admission of your indiscretion morally wrong because of it's consequence, or is it your failure to support the person's emotional needs afterwards? Is it the seeking of a vaccine that's wrong because of it's consequences, or is it, in fact, the failure to put in place adequate bio-security measures? Ethical Naturalists generally argue that for most circumstances we are actually quite good at estimating the long-term consequences of our behavioural strategies and as such general statements about what is morally right based on the cultivation of virtues (a specific form of 'intention') are perfectly objective.