When a mortgage made or assigned to a trustee or trust deed on any real property or any real and personal property located in this state has been heretofore or shall hereafter be foreclosed and bid in on the foreclosure by a trustee for the holders of the bonds or notes secured by the mortgage or trust deed, or for the holders of certificates or other evidences of equitable interest, in the mortgage or trust deed, or when a mortgagor after the mortgage has been executed and delivered, but not before nor as a part of the mortgage transaction, conveys directly to the mortgage trustee, thereby eliminating the mortgagor's title, the trustee may at any time petition the district court of the county in which the property, or any portion of it, is situated for instructions in the administration of the trust. Upon the filing of the petition, the court shall make an order fixing a time and place for hearing it, unless hearing has been waived, in writing, by the beneficiaries of the trust. Notice of the hearing shall be given by publishing a copy of the order one time in a legal newspaper of the county at least 20 days before the date of the hearing, and by mailing a copy of it to each known party in interest then in being whose address is known, at the party's last known address, at least ten days before the date of the hearing, or in any other manner the court orders. If the court deems further notice necessary, it shall be given as specified in the order. Upon the hearing the court shall make such order as it deems appropriate, including an order to sell, mortgage, or lease the property, or any part of it, in the manner and upon the terms as the court prescribes. In the case of a sale, the court, in its discretion, may authorize the trustee to sell at private sale or may direct the sheriff of the county to offer the property for sale at public auction and sell it to the highest bidder for cash. Any sale of property made at public auction shall be reported to the court for confirmation and be confirmed by the court before it is effective and valid. Notice of hearing on the confirmation shall be given to all parties in interest who have appeared in the proceedings. Upon confirmation, the sheriff shall make, execute, and deliver, subject to the terms and conditions the court imposes, a good and sufficient instrument of conveyance, assignment, and transfer. No confirmation of a private sale, mortgage, or lease shall be required. The order of confirmation in the case of a sale at public auction, and the order authorizing a private sale, mortgage, or lease, shall be final and conclusive as to all matters determined in it. It shall be binding in rem upon the trust estate and upon the interests of all beneficiaries, vested or contingent, except that appeal may be taken from the order by any party in interest within 30 days from its entry, by filing notice of appeal with the court administrator of the district court, who shall mail a copy of the notice to each adverse party who has appeared of record.