this worked for me;
from eaforum user toilet ducky:
Goto PunkBuster Online Countermeasures
download punkbuster and update it. THEN a little further down the page you'll see
FOR PLAYERS
FOR ADMINS
Right click on FOR PLAYERS and SAVE AS. Copy that file into your C:\Program Files (x86)\Electronic Arts\Battlefield Bad Company 2\pb. I also put a copy in the C:\Program Files (x86)\Electronic Arts\Battlefield Bad Company 2\pb\htm folder. No disconnects, no issues.
-----------------------------------------------------------
Also for those who cannot add favs or ping not showing.
right-click on your BC2 shortcut > select run as administrator