  We obtain sufficient and necessary conditions for the Choquet-Deny theorem to
hold in the class of compactly generated totally disconnected locally compact
groups of polynomial growth, and in a larger class of totally disconnected
generalized $\ov{FC}$-groups. The following conditions turn out to be
equivalent when $G$ is a metrizable compactly generated totally disconnected
locally compact group of polynomial growth: (i) the Choquet-Deny theorem holds
for $G$; (ii) the group of inner automorphisms of $G$ acts distally on $G$;
(iii) every inner automorphism of $G$ is distal; (iv) the contraction subgroup
of every inner automorphism of $G$ is trivial; (v) $G$ is a SIN group. We also
show that for every probability measure $\mu$ on a totally disconnected
compactly generated locally compact second countable group of polynomial
growth, the Poisson boundary is a homogeneous space of $G$, and that it is a
compact homogeneous space when the support of $\mu$ generates $G$.
