In this paper, we are concerned with the global dynamical behavior of a multigroup SVIR epidemic model, which is formulated as a piecewise-deterministic Markov process. We first obtain sufficient criteria for extinction of the diseases. Then we establish sufficient criteria for persistence in the mean of the diseases. Moreover, in the case of persistence, we find a domain which is positive recurrence for the solution of the stochastic system by constructing an appropriate Lyapunov function with regime switching.