This paper proposes a joint input and state dynamic estimation scheme for power networks in microgrids and active distribution systems with unknown inputs. The conventional dynamic state estimation of power networks in the transmission system relies on the forecasting methods to obtain the state-transition model of state variables. However, under highly dynamic conditions in the operation of microgrids and active distribution networks, this approach may become ineffective as the forecasting accuracy is not guaranteed. To overcome such drawbacks, this paper employs the power networks model derived from the physical equations of branch currents. Specifically, the power network model is a linear state-space model, in which the state vector consists of branch currents, and the input vector consists of bus voltages. To estimate both state and input variables, we propose linear Kalman-based dynamic filtering algorithms in batch-mode regression form, considering the cross-correlation between states and inputs. For the scalability of the proposed scheme, the distributed implementation is also presented. Complementarily, the predicted state and input vectors are leveraged for bad data detection. Results carried out on a 13-bus microgrid system in real-time Opal-RT platform demonstrate the effectiveness of the proposed method in comparison with the traditional weighted least square and tracking state estimation methods.