Microglial cells are resident innate immune cells of the brain that constantly scan their environment with their long processes and, upon disruption of homeostasis, undergo rapid morphological changes. For example, a laser lesion induces in a few minutes an oriented growth of microglial processes, also called "directional motility", toward the site of injury. A similar effect can be obtained by delivering locally ATP or serotonin (5-hydroxytryptamine [5-HT]). In this article, we describe a protocol to induce a directional growth of microglial processes toward a local application of ATP or 5-HT in acute brain slices of young and adult mice and to image this attraction over time by multiphoton microscopy. A simple method of quantification with free and open-source image analysis software is proposed. A challenge that still characterizes acute brain slices is the limited time, decreasing with age, during which the cells remain in a physiological state. This protocol, thus, highlights some technical improvements (medium, air-liquid interface chamber, imaging chamber with a double perfusion) aimed at optimizing the viability of microglial cells over several hours, especially in slices from adult mice.