A 2-1 win on the Faroe Islands for the Danish side on Tuesday night sealed a 5-1 aggregate victory to book a date with the Hammers.
The first leg of the play-off tie will take place on Thursday August 18, with West Ham having home advantage, before the return fixture a week later on August 25. David Moyes’ side host Brighton in the Premier League between those two matches.
Viborg are currently seventh in the Danish Superliga after the first four matches of the season.
West Ham will be looking for another European run this campaign, after they reached the semi-finals of the Europa League last season. They were beaten by eventual winners Eintracht Frankfurt.
Dundee United are also involved in Europa Conference League. The Scottish side play AZ Alkmaar in the third qualifying round, and should they come through that they will face Riga FC or Gil Vicente for a place in the group stage.
Ahead of Thursday’s second leg, United hold a 1-0 aggregate lead.