Acting Secretary Patrick McDonnell, a 19-year veteran of the department, took on what observers say is one of the state’s most challenging cabinet positions when he was named to replace John Quigley, who resigned on May 20 after only 16 months in office.