Grid characteristics have a drastic impact on the stability and control performance of grid-connected systems. Because the grid conditions typically vary over time, online measurements are most desirable for the stability assessment, protection design, and control system optimization of the systems. Previous studies have presented methods based on Fourier techniques and broadband sequences, with which the frequency responses of the grid-connected systems, such as the grid impedance or inverter control loops, can be measured. However, online measurements under unbalanced grids with harmonic voltages have not been comprehensively considered. This letter demonstrates how the previously applied online measurement methods fail in the presence of unbalanced grid and voltage harmonics due to the spectral leakage caused by the Fourier transform. This letter also proposes a simple signal design method to avoid the leakage. Experimental results based on a high-power grid-connected system are shown to demonstrate the effectiveness of the proposed method.