As the penetration of photovoltaic (PV) systems on building rooftops increases, the accumulated effect of the rooftop PV power outputs on electric network operation is no longer negligible. Energy storage resources (ESRs) have been used to smooth PV power outputs, particularly when building load becomes low. In commercial buildings, the batteries of plug-in electric vehicles (PEVs) can be regarded as distributed ESRs. This paper proposes a DC electrical system in a commercial building that enables PEVs to compensate for rooftop PV power fluctuation and participate in tracking signals for grid frequency regulation (GFR). The proposed building system and associated controllers are modeled considering steady-state and dynamic operations of the PV system and PEV batteries. Simulation case studies are conducted to demonstrate the performance of the proposed building system under various conditions, determined by such factors as the maximum voltage, minimum state-of-charge, and desired charging end-time of PEVs batteries.