Ostermann accepted a second lieutenant's commission in the Marine Corps on March 20, 1907, and served continuously until his retirement as a major general on January 1, 1943. His long career took him to Cuba, Panama, China, Nicaragua, Mexico, Haiti, Hawaii, and the Philippines. He was awarded the Medal of Honor in 1917 for his actions during the capture of Fort Dipitie, Haiti, on October 24, 1915. He was part of a mounted Marine detachment sent out from Fort Liberté to reconnoiter towards Fort Dipitie. As the group crossed a river in a deep ravine on the night of October 24, they were suddenly fired upon from three sides by about 400 Haitian rebels, known as "Cacos", concealed in the bushes about from Fort Dipitie. The Marines fought their way forward to a good position and maintained it throughout the night despite continuous hostile fire. At dawn, three squads of Marines commanded by Ostermann, Captain William P. Upshur, and Gunnery Sergeant Daniel Daly advanced in three different directions, surprising and scattering the Cacos in all directions. Upshur's and Ostermann's squads then captured the fort with a total of 13 Marines. Fort Dipitie was demolished and burned and the garrison was forced to flee. "These men were in pitch darkness surrounded by ten times their number and fighting for their lives…" a description relates, "…Had one squad failed, not one man of the party would have lived to tell the story…" Ostermann, Upshur, and Daly all received the Medal of Honor for that battle. Later in the Haitian campaign, on November 11, 1915, Ostermann was wounded in action and returned to the United States for hospitalization. Ordered to Washington, D.C., in 1938 to become the assistant adjutant and inspector of the Marine Corps, he was advanced to the post of adjutant and inspector with the rank of brigadier general in February 1939. With the coming of World War II, Ostermann requested combat duty as either a brigadier general or a colonel. In refusing the request as "impracticable at this time", the Commandant of the Marine Corps expressed his appreciation to Ostermann. Ostermann was retired because of physical disability on January 1, 1943. Because of having been "specially commended for his performance of duty in actual combat" by virtue of the award of the Medal of Honor, Ostermann was promoted to the rank of major general on the retired list. Ostermann died on May 18, 1969. He is buried in Arlington National Cemetery, Arlington, Virginia.
Ostermann's official Medal of Honor citation reads:
In company with members of the Fifteenth Company of Marines, all mounted, First Lieutenant Ostermann left Fort Liberte, Haiti, for a 6-day reconnaissance. After dark on the evening of 24 October 1915, while crossing the river in a deep ravine, the detachment was suddenly fired upon from 3 sides by about 400 Cacos concealed in bushes about 100 yards from the fort. The Marine detachment fought its way forward to a good position, which it maintained during the night, although subjected to a continuous fire from the Cacos. At daybreak, First Lieutenant Ostermann, in command of one of the three squads which advanced in three different directions, led his men forward, surprising and scattering the Cacos, and aiding in the capture of Fort Dipitie.