They are an on/off switch, but they can be accidentally left in the "ON" position, which is going to fry some glow plugs.
Here's how:
There is an electromagnet in there that operates the switch. (Sometimes people will refer to that as a "coil", which is partly accurate.) To turn the switch ON, the electromagnet needs electrical current. That means it needs a + and a - (ground), and we need a way to control that. We need that current flowing on command, not just whenever, and
not all the time. So we need to switch that current across the electromagnet (the coil). We can switch the + OR the ground. Either way works just fine.
In the case of our trucks, the controller card supplies the ground. The + is connected permanently. So, we're switching the ground.
That means we can't have that electromagnet grounded to the case. If it is, the switch is ON all the time. Smokin' glow plugs!
That's why it matters what solenoid you get. If you get one that has the coil grounded to the case, you will turn your glow plugs on as soon as you connect it.
So, there are a lot of solenoids that do NOT have a grounded case, but many DO. That's why you can't just go out and grab
any solenoid that seems to fit. You MUST have one that does NOT ground the coil to the case.
So grab one from your local parts house and get lucky, or unlucky, OR, understand how it works and get the right one.