Electroejaculation is sometimes used to collect a semen sample from your male pony. An electrical current is used to cause ejaculation. Although probably most commonly associated with transrectal electroejaculation (TREE), which uses a bipolar electrode inserted rectally, other electrical contact points have been used to collect semen (e.g. a circular electrode at the base of the penis and another, smaller electrode at the bottom of the head of the penis (mentioned in this article)).
Although having one or more electrodes attached to your ponyboy's penis is perfectly valid, often with electroejaculation the pony's vet or trainer may prefer the pony not to receive penile stimulation (either to make the process faster, less enjoyable (a ponyboy may get distracted if he is constantly dreaming of his daily milking), or easier for the vet (positioning penile electrodes can be more difficult than using a transrectal electrode)).
The alternative then is transrectal electroejaculation. In TREE, a simple sine wave is most often used (with mains frequency) albeit with a moderately high current (0.5-1A). Thus, the power supply just a well insulated (typically up 1500V) step down transformer (0-24V). The electrode used is basically a dildo (like this one for bulls) with several pairs of parallel electrical contacts.
This is fortunate because it dildoes with electrodes are quite common for e-stim, so you won't have to go hunting for some unique electrode. As for a power supply, an e-stim unit can probably accomplish the job. The literature indicates an applied voltage of 15V and an mean current of 0.24A is sufficient to cause ejaculation. A quarter of an amp is probably achievable with e-stim units, and most such units can modulate their outputs with a sine wave (e.g. the "waves" mode on the ET 232).
So, you have your dildo with at least two electrical contacts. You have your power supply. What do you do next?
I'll briefly outline the procedure assuming you are using a commercial e-stim type power supply:
The first step, as with most veterinary procedures, is to securely restrain your pony! He will porbably not like the procedure, and you don't want your valuable pony hurting himself. I trust your imagination and bondage experience, so I won't detail how to restrain your pony. The only recommendation I would make is the use of a gag both to keep the pony from accidentally biting his tongue if the sensations are too intense and also to distract him.
In my experience, gagged ponies are far more tractable (and quieter of course) during veterinary exams (one of my theories is that when wearing a moderately restrictive gag, a ponyboy tends to focus more on the gag (tryng to dislodge it, etc.) than on struggling or resisting).
Anyway...with your ponyboy securely restrained, prepare the electrode (as mentioned above, this is just a rod that has bipolar electrodes) by connecting it to the power supply (which should be off) and then coating it in conductive gel (it doesn't take too much), which will also serve as lube.
Then, slowly insert the electrode in the pony's rectum. You will want to insert it 10 - 12 cm (3.9 - 4.7 inches) up his rectum. Holding it in place, turn on the power supply (make sure it set for a simple sine wave ("waves" mode on the ET 232)), and increase the voltage. Hold it steady at the higher voltage setting for a couple seconds then drop the power to zero, wait a few seconds, then repeat the cycle 3-5 times.
If this doesn't work (i.e. you are getting no results: no leakage, etc.), then try inserting the probe a little more deeply, or pulling it out slightly. Also consider angling the probe toward the ventral/anterior aspect. Finally, if you have a probe with only two electrodes (very likely unless you have a purpose built TREE electrode from a medical/veterinary supply, where most large animal TREE electrodes will have 6 parallel electrodes), you might try slightly turning the probe to make better contact inside the pony.
Finding the most effective position of the electrode can be quite difficult (but this shouldn't be a worry for you since your ponyboy is quite the captive audience at this stage), so try cycling the power up and down several times (as descrobed above) at various different positions and see if you get any results and fine tune positioning from there.