Cove Rangers have been handed a chance to avenge last season’s Scottish Cup defeat to Auchinleck Talbot.
The Aberdeen side were beaten 2-1 in a replay against the Ayrshire side in the second round last October and they will meet at the same stage of the competition next month.
Aberdeen juniors Banks o’ Dee, who defeated Forres Mechanics 4-1 on Saturday, have been dealt a testing trip to Edinburgh City, while Fort William will take on Albion Rovers at Cliftonhill.
Brora Rangers will take on either Nairn or Clach who meet again this weekend following a 0-0 draw on Saturday, while Rothes face Inverurie Locos in another all-Highland League draw.
Elgin City have home advantage against Lowland League side Berwick Rangers, while Paul Lawson’s Formartine United meet Gala Fairydean Rovers.
Bonnyrigg Rose, who knocked out Fraserburgh, host Buckie Thistle and Strathspey Thistle travel to Stirling Albion.
The ties will take place on the weekend of October 19.
William Hill Scottish Cup second round draw:
Stirling University v Linlithgow Rose
Albion Rovers v Fort William
East Kilbride v Gretna 2008
Edinburgh City v Banks o’ Dee
Cowdenbeath v Broxburn Athletic
Nairn or Clach v Brora Rangers
Rothes v Inverurie Locos
Spartans or Deveronvale v Queen’s Park
Elgin City v Berwick Rangers
Formartine United v Gala Fairydean Rovers
Penicuik Athletic v Stenhousemuir
Annan Athletic v Brechin City
Lochee United v BSC Glasgow
Auchinleck Talbot v Cove Rangers
Bonnyrigg Rose v Buckie Thistle
Stirling Albion v Strathspey Thistle