In antiquity, courts could sentence a person convicted of a crime into exile. For example, in ancient Athens, According to the preserved part of the inscription, unintentional homicides receive a sentence of exile, while intentional murders are punishable by death.
Today, article nine of the Universal Declaration of Human Rights states that no one shall be subjected to arbitrary arrest, detention or exile. The Wikipedia article on exile describes the practice of former heads of state being exiled to far-off countries, but this is rather a politically motivated move in an attempt to build stability than a punishment decided in a court of law.
Do any contemporary legislations have the power to impose exile by a court order, such as to sentence a person convicted to exile? I think there are court orders than a person can no longer be close to another person, their home, their workplace or perhaps their children's school, but what about exile as in being forced to leave the home city, region or country completely?