It's usually done as a swab late in pregnancy. Some practitioners do one swab for both the vaginal and rectal areas...some do 2 separate swabs.
Being GBS positive has implications at the time of birth. Most mainstream practitioners require that you receive IV-antibiotics to prevent your baby being exposed to GBS during delivery. My midwives have an alternative treatment recommendation.
GBS exposure can cause a variety of problems for the newborn.
I'm sure others here will be WAY more informative and have links for you...but I didn't want to ignore your post...