The differential perturbative method was applied to the sensitivity analysis for waterhammer problems in hydraulic networks. Starting from the classical waterhammer equations in a single-phase liquid with friction (the direct problem) the state vector comprising the piezometric head and the velocity was defined. Applying the differential method the adjoint operator, the adjoint equations with the general form of their boundary conditions, and the general form of the bilinear concomitant were calculated for a single pipe. Considering that any hydraulic network can be built by connecting different components (reservoirs, valves, pumps, tees, etc.) through pipes, the adjoint relationships for any component, as well as the final contribution to the bilinear concomitant, were calculated. Moreover, an analogy was established in which transmission and reflection coefficients can be derived for any adjoint component. The importance or adjoint function was analyzed when the piezometric head or velocity at a given position and time is chosen as the response functional. In this case, it is shown that the importance function is represented by delta-functions travelling along the hydraulic network with the propagation speed. The calculation of the sensitivity coefficients takes into account the cases in which the parameters under consideration influence the initial condition. For these cases, the calculation can be performed by solving sequentially two perturbative problems: the first one is non-steady, while the second one is steady, with an appropriate selection of a weight function coming from the unsteady perturbative problem. The discretized adjoint equations and the corresponding boundary conditions were programmed and solved by using the method of characteristics. As an example, a constant-level tank connected through a pipe to a valve discharging to atmosphere was considered. The corresponding sensitivity coefficients due to the variation of different parameters by using both the differential method and the response surface generated by the computer code WHAT, solver of the direct problem, were also calculated. The results obtained with these methods show excellent agreement.