How is a turbine engine rotated for starting and inspections?
On the CFM56-7B engine powering the Boeing 737 NG family, the starter and the handcranking input are part of an accessory gearbox which role is to support components rotating with the high-pressure shaft. This gearbox is located outside of the engine core. 

Other engines have a similar design, but the accessory gearbox location may vary, e.g. on the CFM56-5B powering A320 family and 5C powering A340, accessories are at the 6 o'clock position because clearance between nacelle and ground is sufficient.

Accessory gearbox on the CFM56-7B

The accessory gearbox (AGB) is located on the side of the fan containment case. 


CFM56-7 exploded view. Source

It is a set of drive pads hosting accessories, including:


The handcranking mechanism used to turn the N2 shaft during borescope inspection (the N1 shaft can be rotated by moving the fan blades manually). The handcranking drive pad is visible on top on the picture below.
The starter, which is the large assembly at the bottom of the picture.



CFM56-7: Handcranking pad and starter, source Youtube

During borescope inspection, a square drive socket attached to a breaker bar is  inserted into the handcranking drive pad, or a pneumatic motor is used. 


Handcranking drive pad (cover removed). Source: Youtube

Alternatively on other CFM56 engines the core can be turned directly from a pad on the TGB (see below).

AGB to core shaft

There is a gear train within the AGB with its input gear used to transmit movement between the AGB and the engine core.

The AGB is connected to the N2 shaft by two bevel gear gearboxes:


The transfer gearbox (TGB) fixed just aft of the AGB, on the fan frame case. A horizontal shaft links the AGB input gear and the TGB. A radial shaft is also connected to the TGB.
The inlet gearbox (IGB) fixed close to the No 3 bearing, in the fan frame hub. One bevel gear is coaxial to the HPC shaft, the other is coaxial to the radial drive shaft.


Let's remove some components to better see the link from AGB to high-pressure shaft:


CFM56-7B AGB, horizontal and radial shaft, TGB, IGB and engine shafts. Taken from this answer

The radial drive shaft runs within the 9 o'clock strut of the fan frame.

The described mechanism is bidirectional, the AGB is normally driven by the HPT shaft, but when using the starter or the handcranking mechanism, the pads rotate the AGB input gear using the gear train, and the input gear then drives the intermediate shafts and gearboxes.

Pad use

The accessories have allocated pads on the AGB, the ones mentioned have been highlighted in green:


Accessories and their allocated drive pads on the AGB. Source CFM56-7B manual

Rpm ratio of the gears

Data taken from the engine manual:


N2 is 14,460 rpm
Radial drive shaft spins at 1.343 N2 (19,418 rpm)
Horizontal drive shaft at 1.301 N2 (18,811 rpm) 
Starter shaft at 1.002 N2 (14,494 rpm)
Handcranking shaft at 0.986 N2 (14,260 rpm)




Also: Actual photos of the gearboxes in this answer.