Using SCOM 2012 PowerShell Module:
Get-SCOMAgent | where-object {$_.ProxyingEnabled –match "false"} | Enable-SCOMAgentProxy
Using SCOM 2007 PowerShell Snap-in:
Get-agent | where-object {$_.ProxyingEnabled -match "false"}| foreach {$_.ProxyingEnabled = $true; $_.applyChanges()}

Senior IT Pro Trainer & Consultant focused on MS technologies relating to System Center Products SCCM, SCOM, SCO, SCSM