Turn the tee and screw a piece of galvanized, or PVC/ABS with a threaded adapter into it. Regardless of how long it has been installed, it will turn. Either use a large pipe wrench, or a piece of pipe screwed into the opening. Drill a hole in the stud and that will support the pipe.