I am aware that a number of French embassies cooperated with the new Vichy government but what about the countries like Denmark that were occupied but still retained their own governments for a few years? Did they become bases for governments-in-exile, accept the Axis Powers, or just shutdown?
Edit: There has been a great response for the Danes, but anyone else who has information of other embassies for other occupied countries would also be welcome. Thanks!
As far as I'm aware, Denmark is the only country that was occupied by Germany and allowed to retain their government. The Danish occupation was singular in its leniency and the degree of autonomy that was allowed - though that autonomy was very far from complete. I will only speak about the Danish ambassadors in this answer, and I will concentrate on the most important one - the ambassador to the United States, Henrik Kauffmann.
To what degree the continuing Danish government under Thorvald Stauning was legitimate, or under German control, was an issue that divided the Danish ambassadors in foreign countries. The aforementioned ambassador (or in the Danish of the day, the gesandt) to the US, Henrik Kauffmann, declared the government to be under the control of the Germans, and claimed to represent Denmark himself - a sort of one-man government in exile. He telegraphed the other gesandter in neutral and allied countries and asked them to follow his policies. The answers were mixed, with some gesandter agreeing, and others remaining loyal to the government in Denmark - notably the gesandt to the Soviet Union, Bolt-Jørgensen, who called Kauffmann a "traitor."
During the first year of the occupation (1940), the Americans weren't keen on acknowledging Kauffmann as representing Denmark alone. This situation changed as Canadian and American designs on Greenland started to become more important and urgent.
The United States and Canada were interested in establishing airstrips and military bases on Greenland in order to have a stepping stone for planes crossing the Atlantic, and they wished to control the cryolite mine in Ivigtut, important for the production of aluminium for air-frames.
Initially, the US wished to reach and agreement with the Danish government representatives in Greenland itself, the landsfogeder Svane and Eske Bruun. The landsfogeder were only willing to make a treaty lasting until the occupation was over, though, and the US wanted to retain their bases even after the war. Kauffmann proved willing give the Americans the rights indefinitely, and thus the US recognized him as the legitimate representative of Denmark and made the deal - without the Greenlandic people ever having been party to the discussions, naturally.
The Danish government in Denmark was appalled by the treaty and protested furiously. The treaty was both a break with a decades long tradition of Danish neutrality, a breach of Danish (Greenlandic) sovereignty, and a decision made by a gesandt who was not empowered to do so. More importantly in the short term, it aggravated the German occupiers, who called for Kauffmann to be stripped of his citizenship and treated as a traitor.
The Danish government attempted to recall Kauffmann and declare the treaty annulled, to little effect. His possessions in Denmark were confiscated, but his citizenship wasn't taken from him. He continued to act as a representative of the "free Denmark" for the rest of the war, though his unofficial leadership of it mostly passed to Christmas-Møller in London in 1942. After Denmark was liberated, he became a minister in the post-war government, and in 1946 he returned to Washington as the gesandt.