Timely performance of preventive maintenance (PM) tasks is a critical element of manufacturing systems. Since the majority of PM tasks requires that equipment be stopped, these tasks can generally only be performed during nonproduction shifts, breaks, or other scheduled downtime. Thus, there is a trade-off between time dedicated to production and time available for preventive maintenance. One approach to mitigate this trade-off is to perform maintenance during scheduled production time by strategically shutting down equipment for short time periods. This research developed a systematic method on when to shut down equipment to do maintenance in an automotive assembly environment. It is called maintenance opportunity. The method incorporated real-time information about production and machine failure conditions. A simulation-based algorithm is developed by utilizing the buffer contents as well as machine starvation and congestion to obtain maintenance opportunities during production time.