A man convicted of using a chainsaw to cut his way into a federal government office in Canberra's south has avoided being sent to jail because of his mental illness.

In March last year Benjamin Dunne, 35, caught a taxi to the Department of Human Services at Greenway where his former colleagues worked and used the chainsaw to cut his way in.

He initially hit the glass security door several times and when this failed, he used the chainsaw to smash a hole through a glass security panel to gain entry.

The public service building was quickly evacuated and no-one was hurt.

Police officers told the court they found Dunne standing in a corridor between office cubicles, holding the running chainsaw.

Dunne had earlier posted a warning on Facebook, which read in part "Pathetic, they could have saved lives".

The court heard he had been angry at the handling of a sexual harassment claim, which had seen him leave his job on bad terms.

Justice Hilary Penfold noted prosecution concerns about the gruesome connotations of chainsaws in popular culture.

But she told the court she was satisfied the offence was the result of Dunne's mental health problems which reduced his culpability.

Dunne has been given a two-year suspended sentence, with a two-year good behaviour order.