During Donald Trump’s presidency (2017-2021), he had four people serving as Defense Secretary. These are:
1. James Mattis (2017-2019)
2. Patrick M. Shanahan (Acting Secretary, 2019)
3. Mark Esper (2019-2020)
4. Christopher C. Miller (Acting Secretary, 2020-2021)
If you are referring to a specific time under Trump’s administration, feel free to clarify and I’ll adjust the information accordingly.