The 28-year-old victim was attacked at a property in Sydney Gardens, Lockerbie, Dumfries and Galloway, between 1.30pm and 2.30pm on Saturday.
He was treated for minor injuries following the incident.
Police believe two men were involved in the raid and are appealing for information.
One man was around 5ft 9in tall, aged between 22-30 with blondish coloured hair and was wearing a hi-viz yellow jacket, dark boiler suit, hard hat and ear muffs, and carrying some sort of tool bag.
The second man was also aged between 22-30, of slim build with black hair and wore a navy blue Adidas tracksuit.
Both men spoke with west of Scotland accents.
Detective Inspector Dean Little said: “This type of crime is very rare indeed for our area and a team of detectives are now working on the case with a view to catching those responsible.
“We are asking anyone who lives in Sydney Gardens, or the surrounding area to get in touch with us if they saw either of the two men described.
“Likewise we would be keen to hear about any vehicles which might have been seen entering or leaving, or even parked up in the area of Sydney Gardens or surrounding streets on Saturday.
“We are also reviewing CCTV footage from cameras in the area, and any dash cam footage which anyone has while driving in the area would be welcomed.”
Anyone with information is asked to contact Police Scotland on 101 quoting reference number 0301 of 15/4.