Ok basically, here's the deal. You can't make a macro for intimidation just because it's a buff that goes on your pet for 15 seconds, and not a melee attack (unlike Kill Command). So you have to get a macro that attacks a certain target, then once your pet has reached that target you have to manually hit your Intimidation, which will cause your pet to stun that target. But the tricky part is this: if you have your pet on assist, it will go back to attacking the target you are attacking, instead of the one you assigned for it to attack. So your macro will end up looking like this:
/petdefensive
/petattack [target=mouseover,harm]
And if you want to do this for a focus target:
/petdefensive
/petattack [target=focus]
You can switch your pet back to Assist stance using this macro (or you can just keybind the Assist button on the pet bar):
/petassist
As I said earlier, once you see your pet has reached the target, then hit your Intimidation and it will take effect on that target. Also for the first two macros I gave you, if you want to use Passive stance instead of Defensive (both work), just use /petpassive.
Hope I helped and if you have any other questions feel free to ask.
Edit: Another useful macro I use is this one, to make it attack my current target (let's say you sent it to your mouseover target and decide it's better to stun your current target instead) and switch it back to Assist stance:
/petassist
/petattack