Grand taxis are permitted to travel outside of the city limits. You can take the big taxi, e.g. from Marrakech to Agadir etc. These taxis can be found only in specific parking places.
E.g. in Marrakech, for destinations close to the city, like Ourika Valley, Agafay, the taxis are waiting in the Medina, in the parking close to the Kasbah entrance. For orientation, find a hotel “Villa Verde”, taxis are in front of it. In this link, I added the grand taxi parking coordinates.
If you want to reach other Moroccan cities, go to the grand taxi parking place close to the Bab Doukalla bus station. All taxi drivers know this place. How does it work? You go to the taxis parking, and someone will ask where are you going. Then, it will lead you to the right taxi driver. After the driver collects at least 4 passengers, you are ready to go. Pay only for your seat. Prices are fixed.