C. The secretary shall not have the power to invest funds or property of any such estate, except where it shall appear necessary to purchase any real or personal property or any interest therein, in order to protect an equity which such estate has in such property. Such purchase by the secretary shall not be made without the approval of any corporation or person whose approval would have been necessary to such purchase by the institution prior to the taking of possession by the secretary, and of the court which has exercised jurisdiction over such estate. If no court has yet exercised jurisdiction over the estate, then the approval either of the court of common pleas or of the orphans' court of the county in which the place of business of the institution is situated shall be procured. Except where otherwise specifically provided, references in this act to the court which has exercised jurisdiction over an estate of which an institution in possession of the secretary was fiduciary, shall be construed to refer, in cases in which the institution was executor or administrator, to the orphans' court of the county of which the register of wills issued the letters testamentary or letters of administration respectively, and in all other cases, to the court of common pleas or the orphans' court in which an account of the estate has been filed, or which has, in any manner, exercised control or supervision over the administration of such estate by the institution as fiduciary.