(written from a Production point of view)
Viacom was a major media conglomerate that owned Paramount Pictures and, as such, owned the rights to the first ten Star Trek films. They also had ownership to Paramount Pictures' home entertainment operations, which for Star Trek encompassed the first ten films in full, but only in part for the other franchise elements, including the television productions, produced before 2006.
Viacom was founded in 2006 following a split between CBS and the former Viacom the previous year. The former Viacom, which previously owned all rights to the Star Trek franchise, was re-established as CBS Corporation, which became the sole owner of the entire franchise, excepting the first ten films. Viacom's television division (Paramount Television), which includes the Star Trek television franchise, fell under the ownership of CBS and was renamed CBS Paramount Television, now known as CBS Studios. Paramount produced Star Trek, Star Trek Into Darkness, and Star Trek Beyond under a separately negotiated license from CBS, but only co-shared the rights to them, unlike the first ten films. The new Viacom also retained ownership of the Paramount Network (formerly Spike), MTV, and Nickelodeon.
Viacom, in partnership with News Corporation and MGM, launched Epix, a new pay movie channel, in fall 2007. Star Trek was run on that channel, as the ten-year exclusive deal between Paramount Pictures and CBS' Showtime expired at the end of 2007. 
This incarnation of Viacom and CBS Corporation were both controlled by National Amusements.