"Alarm barking" is genetic, and present in most dogs to varying degrees, and usually cannot be stifled completely. German Shepherds are quite prone to this behavior. Dogs do this to alert their "pack" to the presence of an intruder.
Most people want their dogs to bark a warning or alarm when someone is at the door, but want it to stop quickly. To do this, you need to teach your dog "Enough".
To teach "Enough," set up a situation in which your dog will bark, but not excessively; knock on the door, for instance. After one or two barks, stop knocking and make a sound or distraction that will get her to switch her attention to you. If she stops barking, immediately say "Enough" and reward her with a treat and praise. If she does not stop barking, put that delicious treat right in front of her nose. When she stops barking for a second or two say "Enough," wait a few more seconds and if she is quiet, give her the treat and praise.
Timing is critical – she must be quiet when you give her the treat or she will think she is being rewarded for continuing to bark. Be sure to say "Enough" when she is quiet, not when she is barking. Later, as she associates "Enough" with being quiet, you can use it as a command to stop barking.
You need to start this training with just one or two people - a crowd is too much stimulation.
Also, make sure you never soothe or comfort your dog when she's barking ("Oh, it's o.k. - it's allright") Dogs see this as PRAISE for barking.