Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in the Registration Statement (Form S-8 No.
333-45062) pertaining to the Waste Management Retirement Savings Plan For Bargaining Unit Employees
of our report dated June 27, 2007, with respect to the financial statements and schedule of the
Waste Management Retirement Savings Plan for Bargaining Unit Employees included in this Annual
Report (Form 11-K) for the year ended December 31, 2006.
/s/ Ernst
& Young LLP
Houston, Texas
June 27, 2007