As you said, it always comes down to needs of the Navy, but for YNs it is pretty easy to get shore duty out of A school at this point.
Here is a link to the NPC page for YN
http://www.public.navy.mil/bupers-np.../Pages/YN.aspx
Click on YN Community Overview (current as of Oct 2)
Look at the Force Structure Manning to BA for E1-E3
Sea is currently staffed at 90.4% of BA (raw numbers = 35 openings)
Shore is currently staffed at 54% of BA (raw numbers = 69 openings)
So right now it is pretty easy to get shore.
And I also know that specifically out of the last graduating class nearly everyone got either shore duty or overseas.