I was just browsing random stuff on the internet, and I came across this article about the parker solar probe. The rhetoric was like "oh my, the sun is so hot but the probe won't melt.. etc. etc.", and I had a flash back to someone lecturing about tokamak fusion, so I thought the article was going to say something about magnetic fields, but it didn't. And as I was thinking about it I remembered the earths magnetic field, but that just channels the suns plasma to the poles? For a solar probe you'd need to channel the plasma from coming directly towards the object to going any other direction... it's like the opposite of confinement need for fusion, but I'm not smart enough to think about it that abstractly and say it's possible...
A magnetic shield of the sort you are proposing can indeed block plasma, and so can prevent damage due to direct exposure to the plasma. However, a magnetic shield cannot block electromagnetic radiation. The following information is a bit off the point of your question, but it shows the importance of electromagnetic radiation to a solar probe:
The sun radiates a black-body spectrum of light at 5,778 Kelvin. The temperature of Mercury's surface at an average of 36 million miles from the sun is ~800 Kelvin or about 500 C. The Parker Solar Probe will approach to ~6.2 million miles from the sun's surface.
In this paper, it is shown that the equilibrium temperature of an object at distance $d$ from a star is
where $T_p$ is the temperature of the object, $T_O$ is the temperature of the star, $A$ is the albedo or fraction of light reflected by the object, $d$ is the distance between the star and the object, and $R_O$ is the radius of the star. A decent mirror reflects about 99% of all light in the relevant spectral range. So, the equilibrium temperature of the Parker Solar Probe, if it is completely covered with a silver mirror, should be roughly 400K or ~105C. Hot enough to boil water. Give it an albedo of, say, 75% instead of 99%, and that temperature goes up to ~ 890K or roughly 600C, which is well above the melting point of most solders. The maximum operating temperature of a SiC transistor is 225C.
So, designing a solar probe is a challenging task!
It's an interesting idea, and in principle, you might be able to confine the solar plasma away from such a probe using a strong enough magnetic field. However, in practice, all of the things that make building a tokamak so hard become much more difficult in this situation.
For one, even though we've become pretty good at confining plasma using magnetic fields over the years, anything we confine is still vulnerable to instabilities. The dynamics of confined plasma are very complicated, and border on chaotic in many situations; as such, none of the field configurations that we use at the moment completely eliminate the possibility of a chunk of plasma (all of it, in a lot of cases) escaping confinement and colliding with the wall after a short time. In a tokamak, this is usually fine, as the plasma is rarefied enough that the total momentum transfer causes no mechanical damage (though the high energy density does tend to cause some very interesting surface chemistry to happen). Within the solar atmosphere, this may not be the case, especially if the instability allows for a continuous flow of plasma in from the solar atmosphere, rather than a single burst of energy and momentum. So it's not likely that the solar atmosphere will be held off for long.
And that's assuming that you can even maintain a constant magnetic field to begin with. Tokamaks are built to be pulsed-power devices, where part of the confining field is created by ramping current up and down in a giant solenoid. So the field will only exist in pulses in the first place. Even if you don't build a tokamak and find a way to create a favorable steady field configuration, creating the field in the first place requires two things: lots of power, and an efficient way to get rid of heat. Neither of these are particularly plentiful in space. Even if you find a way to carry enough power with you to efficiently create the magnetic field, sustaining it without your coils melting (if they're conventional electromagnets) or quenching and even more rapidly melting (if they're superconducting electromagnets) or demagnetizing after they reach the Curie temperature (if they're permanent magnets) will be difficult, especially if you're surrounded by the hot plasma of the solar atmosphere.
The thing you are describing is called a magnetic sail.