A ground-mounted or pole-mounted solar energy system is considered to be abandoned or defective if it has not been in operation for a period of 12 months. If abandoned, the solar energy system shall be repaired by the owner to meet federal, state, and local safety standards, or be removed by the owner within the time period designated by a county or city building code official. If the owner fails to remove or repair the defective or abandoned solar energy system, the county or city may pursue a legal action to have the system removed at the owner's expense.