Because both standard and miniature schnauzers are so intelligent, they tend to learn fast. It's natural for a dog to protect its home territory from strangers. You probably won't have to actually teach your young dog to be protective, but if you wish to have your dog specifically trained for security work, it's imperative that it first be well versed in simple obedience.
As soon as your dog hears your doorbell, it should react to the sound by barking or growling. You should praise your schnauzer for this quick reaction. If the dog isn't already at the door, command it to "come!" and "sit!" Having a family member or friend ring the bell for you while are in the house with your dog helps this training.
At no time should you permit your dog to make actual contact with the "stranger". A sharp bark or 2 is all that you are aiming for at this point.