The human brain is populated by perivascular T cells with a tissue-resident memory T (TRM)-cell phenotype, which in multiple sclerosis (MS) associate with lesions. We investigated the transcriptional and functional profile of freshly isolated T cells from white and gray matter. RNA sequencing of CD8+ and CD4+ CD69+ T cells revealed TRM-cell signatures. Notably, gene expression hardly differed between lesional and normal-appearing white matter T cells in MS brains. Genes up-regulated in brain TRM cells were MS4A1 (CD20) and SPP1 (osteopontin, OPN). OPN is also abundantly expressed by microglia and has been shown to inhibit T cell activity. In line with their parenchymal localization and the increased presence of OPN in active MS lesions, we noticed a reduced production of inflammatory cytokines IL-2, TNF, and IFNγ by lesion-derived CD8+ and CD4+ T cells ex vivo. Our study reports traits of brain TRM cells and reveals their tight control in MS lesions.