The second Soviet Almaz military space station both had and tested an externally-mounted autocannon, specifically a Rikhter R-23 (according to some sources). It had 32 rounds of ammunition. The gun was fixed to the station such that the only way to aim was to rotate the entire station.
The International Space Station is designed to withstand impact from orbital debris, largely through the use of Whipple shielding on at least the pressurized modules. Here's an article describing the testing of a Whipple shield as on the Kibo module: it maxes out at an 11 mm aluminum ball fired at 6 km/s which failed to penetrate the inner wall.
On the other hand, this book describes some limitations of Whipple shielding:
The Whipple bumper is most effective at high impact velocities, where the disruption and dispersion of the impacting projectile can be maximized. At lower velocities, the collision with the bumper may not break up or liquefy the impactor; thus it may still be intact when it strikes the catcher.
Other more effective shields are placed in forward-facing areas where most impacts are expected. Less capable shields are located in aft and nadir-facing areas that are expected to be hit less frequently.
Given 32 rounds of ammunition and attempting to aim by pointing the entire station could the Almaz gun be expected to puncture the pressure hull of the ISS? Where would the best chance of success be? How much damage could the gun do (and would depressurizing the station be the worst case)?
Assume that Almaz 2 and the ISS are nearby in the same orbit (so no orbital-velocity speed boosts to the bullets). Also, try to answer using the ammunition the Rikhter R-23 fired: 175 gram HEI projectiles (though I'm also curious about the damage generic chunk of lead could do).
To put it another way: The ISS is shielded to protect against random strikes by high-velocity orbital debris; does that shielding protect well against a limited number of lower-velocity but targeted small projectiles?
Whipple shielding seems like it's only effective for multiple strikes if the impacts aren't all in the same small area, but I don't know how well the Almaz station could maintain aim or how accurate the gun would be.
I get the impression a variety of different shields are used on the ISS, but I didn't find a comprehensive comparison of them.