Theoretically, you can collect DNA millinnia after death. THey’ve successfully retrieved DNA from mummies in Egypt, and used it to find out the identity or relationship of the mummies to each other.
it does degrade over time and is present only in soft tissue (with the mummies they went for bone marrow or the insides of their teeth) but the biggest issue you face is contamination. Since we shed DNA every time we shed skin cells (aka all the time), care has to be taken. HOwever, like you’ve seen on TV, the sterile swab of the inner cheek, that works. And I would think that kind of collection would fit in with the ‘do not desecrate the body’ rules they have.
Given the sensitivities they’ve shown so far, it wouldn’t surprise me if troops weren’t briefed in exactly how to retrieve DNA and other identifying material without breaking any religious laws.