McDonald gained the logins and passwords for four administrators and 275 staff members in the attack and then contacted the university and claimed responsibility, the court heard.
He also boasted about the attack on social media and in a radio interview, Judge Sinclair said.
The university then laid a complaint with Victoria Police's e-crimes squad, and a search warrant was executed at McDonald's Auckland home.
Since his arrest, the court heard he had voluntarily completed 50 hours' community service in his bid to obtain a discharge without a conviction.
Addressing McDonald, Judge Sinclair said the intrusion was regarded seriously by the court because people's privacy was jeopardised.
"However, it appears to be accepted by police that after access was gained, you promptly notified the University of Melbourne and advised them that they had a security problem.
"You also provided the university with your full details so that the university could contact you regarding the issue.
"You say you accessed the computer system out of curiosity and interest, there is no evidence that you did this maliciously."
Judge Sinclair told McDonald she hoped he would use his computer skills in a more appropriate and productive way going forward.
"You were co-operative with police, and I hear you are remorseful," she said.
In granting a discharge without conviction, Judge Sinclair said she considered his offending to be at the lower end of the scale and took into account that he was completing a degree in computing and a conviction would harm his chances of travelling to America for work in the future.