Vitamin D and the immune system work together. You might be surprised that vitamin D can boost and suppress the immune system. Vitamin D can boost primitive defenses of macrophages (Cathlecidin, LL37, and Beta Defensins. However it reduces classic inflammatory cytokines like IL1beta, Il6, and TNFa. Vitamin D also suppresses the adaptive immune system, B and T cells. This means that high levels of vitamin D (10,000 IU) can be prescribed by a doctor to treat autoimmune diseases like lupus, MS, and psoriasis.
Sources:
https://www.ncbi.nlm.nih.gov/pmc/arti...
https://www.ncbi.nlm.nih.gov/pmc/arti...
https://www.ncbi.nlm.nih.gov/pmc/arti...
https://pubmed.ncbi.nlm.nih.gov/8394351/