It is estimated that only 50 per cent of debts are currently recovered from those who own the buildings in need of repair and that local authorities could be out of pocket to the tune of almost £4 million.
But a Member's Bill from Highlands and Islands Labour MSP David Stewart has finished its journey through Holyrood and now needs only Royal Assent to become law.
This is the first Opposition Member's Bill passed this session and received unanimous support by all parties in the Parliament.
Mr Stewart said: "Too many buildings have been allowed to drift into disrepair and need urgent remedy. My Bill aims to enable councils to carry out desperately-needed repairs."
He was said councils could feel more confident in carrying out repairs, leading to fewer repairs being delayed, scaled back or even cancelled due to concerns over cost. recovery.
Scottish Building Federation Managing Director, Vaughan Hart said: "SBF supports this legislation as a welcome move to support the repair of unsafe buildings in Scotland."