The failures of C Smith Roofing were spotted by health and safety staff who could see unsafe scaffolding from their office window.
Owner Chris Smith was given an eight-month prison sentence suspended for two years and ordered to complete 200 hours of community service.
Leeds Crown Court heard that in November 2015 Smith was contracted to carry out some roof repairs to a Guest House roof in Northallerton.
Scaffolding was erected along the full length of the roof at the front of the property.
But due to the presence of a conservatory structure at the rear, the company only erected a partial scaffold.
It did not take the conservatory into account which left approximately two thirds of the rear roof edge unprotected.
In February 2016, nearby health and safety risk managers at North Yorkshire County Council could see the project from their office window and had concerns about the safety of the two workers on the roof.
Two operatives working under the control of Smith were at risk of falling approximately seven metres from the unprotected edge of the roof at the rear of the property.
Chris Smith of Northallerton North Yorkshire pleaded guilty to breaching safety regulations. As well as his suspended prison sentence and unpaid work requirement, he was also ordered to pay £5,800 costs.
After the hearing, HSE inspector Tania Shiffer said: “Work at height, such as roof work, is a high-risk activity that accounts for a high proportion of workplace serious injuries and fatalities each year.
“There were not suitable or sufficient measures in place to prevent the risk of a person falling a distance liable to cause personal injury.
“This is a good example of HSE working closely with local authority partners.”