(2)The Municipal Commissioner or the Executive Officer may, if it appears to him necessary so to do, cause a proper hoarding or fence or other means of protection to be put up at the expense of the owner of such wall or building for the safety of the public or the inmates thereof; and may, after giving them such notice as the Municipal Commissioner or the Executive Officer may think necessary, require the inmates of the building to vacate it.