The problem of synthesis of the optimal control for a stochastic dynamic system of a random structure with Poisson perturbations and Markov switching is solved. To determine the corresponding functions for Bellman functional and optimal control the system of ordinary differential equation is investigated.