|If connected = false then everything between it and the last end if is skipped.|
WScript.Quit is only executed if connected = true AND dn = ""
You could achieve the same thing with a single statement:
dn = CheckForCN(empCN)
If connected = "True" AND dn ="" then WScript.Quit
This would execute a little faster and with a lot of If Then statements can make an appreciable difference.
This is a standard If/.Then construction that exists in one form or another in every programming language.
iF computerNameprefix gets a different value depending on the value of cou_id you have no choice but to have thirty case statement.
However without seeing all the code it is difficult to say what is best.
There are many variations in the case statement:
Case 1,2,3,4 for all values of those numbers
Case 1-10 for everything between and including 1-10
Case Else as a default if non of the previous Case statement apply.