16 Pa.C.S. § 12350
(a) Elected.— A county commissioner, sheriff, coroner, prothonotary, register of wills, recorder of deeds, treasurer, county auditor or county controller, clerk of courts, district attorney or any other officer of the counties, whether elected or duly appointed to fill a vacancy, may be removed from office only:
(b) Appointed.— An appointee to a county office or position other than to an elected office shall be: