It depends which template do you use, for example Exchange 2010 Statistics with PowerShell runs on target server, but the older one Exchange 2007-2010 Mailbox Send and Receive Statistics with PowerShell runs on Orion box. You can see prerequisites, there's always where Exchange Management Tools must be installed. On target Exchange server or on APM server.
The second option how to determine where the script runs is looking to template and if there's something like
invoke-command -Session $sess -script-block { Get-MailboxDatabase ... }
it runs cmdlets on target Exchange server.
Generally I would advice to use templates which runs cmdlets remotely on target Exchange server. For exampleExchange 2010-2013 Mailbox Send and Receive Statistics with PowerShell it runs remotely on target Exchange server too.
If you're experimenting with Exchange templates you can always try AppInsight for Exchange, which is part of the SAM 6.1 release, currently in beta.