(a) Direction of writs.--A writ of attachment of the person shall be directed to and executed by the sheriff of the county in which the court or branch of the court is located or of any county where the person to be attached is located.
(b) Discharge of person attached for contempt.--Any person attached for contempt may be discharged from custody by the orphans' court division upon purging himself of contempt to the satisfaction of the division by whose order he was attached.