There are $n^n$ equally likely ways to distribute the $n$ balls among the cells. We find the number of ways in which precisely one cell is empty.
The empty cell can be chosen in $n$ ways. For each such choice, the cell that will have two balls can be chosen in $n-1$ ways.
For each such choice, the two balls that go into the lucky cell can be chosen in $\binom{n}{2}$ ways. That leaves $n-2$ balls and $n-2$ cells. The balls can be permuted among these cells in $(n-2)!$ ways.
So with a denominator of $n^n$, the numerator is
$$\binom{n}{1}\binom{n-1}{1}\binom{n}{2}(n-2)!.$$
This simplifies to $\binom{n}{2}n!$.
Remark: For fun, we obtain $\binom{n}{2}n!$ "directly." The balls that are to be glued together can be chosen in $\binom{n}{2}$ ways. Now we have $n$ "abstract" balls: the $n-2$ remaining ordinary balls, our glued pair, and the invisible ball. These $n$ objects are to be assigned, one object to a cell, to our $n$ cells. That can be done in $n!$ ways.