We study formation and conductance of alkanedithiol junctions using density functional based molecular dynamics. The formation involves straightening of the molecule, migration of thiol end-groups, and pulling out Au atoms. Plateaus are found in the low-bias conductance traces which decrease by 1 order of magnitude when gauche defects are present. We further show that the inelastic electron tunneling spectra depend on the junction geometry. In particular, our simulations suggest ways to identify gauche defects.