My advice with a 2 year old is to talk about 'good choices' and be very consistent with a set discipline plan for whenever she makes 'bad choices'.
I usually did something like this:
first offense-- "Grace, throwing toys at your brother is not a good choice. Do not do it again, okay?" (I had them answer me "ok, Mommy")
second offense-- "Grace, you just threw a toy again. Mommy told you it is not a good choice to do that because you may break something or hit someone. If you throw toys again you will get a time out, do you understand?" (I had them answer me "ok, Mommy, I understand")
third offense-- "Grace, Mommy told you if you throw toys again you get a time out." I would then put her in time out in a time out chair or mat. If she cried or fought me about going into time out I would tell her "if you scream and fight you get an extra minute (or 2 minutes, whatever I felt was appropriate). As a rule, I do time out the # of their age + one minute. At 2 they got 3 minutes time out. At 7, Ben gets 8 minutes if he's in time out.
fourth offense was usually another time out (sometimes in their bed), or a toy got into time out for the day (especially if it was a toy causing the bad behavior). fifth time was often a single spank to her bottom... of course, with warning in advance that the next time she would get a spank... etc. Not in anger, though. If I am at all angry I just do another time out. I know not everyone agrees with spanking, so I am treading lightly on this...
If the behavior was happening during a play date, we would usually leave after the third time as a consequence. 2's are tough, but setting up a consistent discipline really helped me and I think has made the 3's and 4's easier. I don't have many struggles with their behavior now, and if I do they know what to expect. Sorry so lengthy... I hope this helps somehow.