Sunroof Control Module Programming and Setup: Notes
WARNING: This page does not describe the selected car, but rather 8 other vehicles, including the 2012 GMC Yukon XL, 2012 GMC Yukon, 2012 Chevrolet Tahoe, 2012 Chevrolet Suburban, and 2012 Chevrolet Avalanche. However, it is still accessible from the selected car via links, so may be relevant.
When replacing the sunroof motor/control module, the sunroof motor/actuator initialization/teach procedure must be followed.