You can select which objects and, or which shadows render independently. For instance, you can render an object so it does not cast shadows, but can receive shadows cast by other objects.
To set which objects do or don’t cast shadows, see Render Stats in the Rendering guide.
If you want to isolate only the shadow information on objects that receive shadows, assign a Use Background material to them.
Select a range of objects and shadows to render
If you want to render only objects and shadows within a specific distance range from the camera (for example, only foreground objects), you can use the camera’s clipping planes to control which objects and shadows render. (However, separating objects into layers is better from a maintenance standpoint.)
See Clipping planes in the Rendering guide for more details.