This article explores energy planning and management in microgrids using Advanced Dynamic Programming (ADP) to address uncertainties in solar and wind power generation. Probability Distribution Functions (PDFs) are employed to accurately estimate the fluctuations of renewable resources, ensuring a stable and efficient energy management strategy. The proposed approach focuses on optimizing the logistical management of batteries and distributed generation, enhancing microgrid efficiency in power integration while maintaining economic feasibility. MATLAB-based simulations validate the effectiveness of this method, demonstrating key benefits such as reduced curtailment of renewable generation and improved system reliability. A major advantage of ADP is its rapid implementation, making it well-suited for real-time applications and scheduling optimization. The research findings highlight that adopting this strategy not only reduces operational costs but also increases the share of renewable energy while stabilizing power supply. Additionally, sensitivity analysis confirms that the model remains effective across various microgrid configurations and resource conditions. By leveraging ADP, microgrids can enhance their resilience and adaptability in managing fluctuating renewable energy sources, ultimately contributing to a more sustainable and cost-effective power system. This study underscores the potential of ADP as a valuable tool for optimizing energy distribution in modern microgrid networks.