§ 1017. Placement of children. 1. In any proceeding under this article, when the court determines that a child must be removed from his or her home, pursuant to part two of this article, or placed, pursuant to section one thousand fifty-five of this article, the court shall direct the local commissioner of social services to conduct an immediate investigation to locate any non-respondent parent of the child and any relatives of the child, including all of the child’s grandparents, all suitable relatives identified by any respondent parent or any non-respondent parent and any relative identified by a child over the age of five as a relative who plays or has played a significant positive role in his or her life, and inform them of the pendency of the proceeding and of the opportunity for becoming foster parents or for seeking custody or care of the child, and that the child may be adopted by foster parents if attempts at reunification with the birth parent are not required or are unsuccessful. The local commissioner of social services shall record the results of such investigation, including, but not limited to, the name, last known address, social security number, employer’s address and any other identifying information to the extent known regarding any non-respondent parent, in the uniform case record maintained pursuant to section four hundred nine-f of the social services law. For the purpose of this section, “non-respondent parent” shall include a person entitled to notice of the pendency of the proceeding and of the right to intervene as an interested party pursuant to subdivision (d) of section one thousand thirty-five of this article, and a non-custodial parent entitled to notice and the right to enforce visitation rights pursuant to subdivision (e) of section one thousand thirty-five of this article. The court shall determine:

(a) whether there is a suitable non-respondent parent or other person related to the child with whom such child may appropriately reside; and

(b) in the case of a relative, whether such relative seeks approval as a foster parent pursuant to the social services law for the purposes of providing care for such child, or wishes to provide free care and custody for the child during the pendency of any orders pursuant to this article.

2. The court shall, upon receipt of the report of the investigation ordered pursuant to subdivision one of this section:

(a) where the court determines that the child may reside with a suitable non-respondent parent or other relative or other suitable person, either:

(i) grant an order of custody or guardianship to such non-respondent parent, other relative or other suitable person pursuant to section one thousand fifty-five-b of this article; or

(ii) place the child directly in the custody of such non-respondent parent, other relative or other suitable person pursuant to this article during the pendency of the proceeding or until further order of the court, whichever is earlier and conduct such other and further investigations as the court deems necessary; or

(iii) remand or place the child, as applicable, with the local commissioner of social services and direct such commissioner to have the child reside with such relative or other suitable person and further direct such commissioner pursuant to regulations of the office of children and family services, to commence an investigation of the home of such relative or other suitable person within twenty-four hours and thereafter approve such relative or other suitable person, if qualified, as a foster parent. If such home is found to be unqualified for approval, the local commissioner shall report such fact to the court forthwith.