Microbes play an important role in maintaining the structure and function of coastal wetland ecosystems and can indicate changes in the external ecological environment. The effect of invaded Spartina alterniflora and restored mangrove on soil microbial functional diversity was explored. The surface soil samples of S. alterniflora and the native Kandelia obovata forest with different restoration ages were collected in Quangang, Fujian, China. The soil physical and chemical factors were measured, and the functional diversity of soil microbial communities was studied using the Biolog-ECO plate methods. Compared with the mudflat, both the S. alterniflora and mature mangrove increased the soil carbon and nitrogen contents. The average well color development value in mudflat site was significantly higher than that in the S. alterniflora, while the native mature K. obovata had the lowest value. The Shannon, Simpson, and McIntosh indices of soil microorganisms were measured at 168 h and no significant differences were found among different vegetation types. The invasion and restoration changed the carbon source utilization of microorganisms that carbohydrates became the primary sources in S. alterniflora and mature K. obovata sites, while the microorganisms at mudflat consumed diverse carbon sources. The S. alterniflora invasion and mangrove restoration both increased the vegetation biomass and soil carbon and nitrogen contents and then reduced soil microbial carbon sources, but the functional diversity indexes were not affected. Further observations are needed to to accurately evaluate the invasive effects of S. alterniflora in mangrove ecosystems.