Infection of the endocrine glands with species of mycobacterium, most often mycobacterium tuberculosis.