These verses can be found in Chapter 3 Upodghatapada of Brahmanda Purana
(translated by GV Tagore).
कारणं तु स्मृता ह्येते नानार्थेष्विह देवताः |
एकं प्रशंसमानस्तु
सर्वानेवप्रशसति || ९३
kāraṇaṃ tu smṛtā hyete nānārtheṣviha devatāḥ |
ekaṃ praśaṃsamānastu
sarvānevapraśasati || 93
93.These deities are remembered as the cause of the different affairs. A person who praises one, praises all.
एकं निन्दति यस्त्वेषां सर्वानेव स निन्दति |
न प्रद्वेषस्ततः कार्यो
देवतासु विजानता || ९४
ekaṃ nindati yastveṣāṃ sarvāneva sa nindati |
na pradveṣastataḥ kāryo
devatāsu vijānatā || 94
94.He who censures one censures all. Hence, no one who knows these, should have hatred towards the deities.
Reverse order of verses can be found in Chapter 66 of Vayu Purana. (translated by Sudharshan Kumar Sharma)
एकं निन्दति यस्तेषां सर्वानेव स निन्दति।
एकं प्रशंसमानस्तु
सर्वानेव प्रशंसति।
एकं यो वेत्ति पुरुषं तमाहुर्ब्रह्मवादिनम्।।
११४।।
ekaṃ nindati yasteṣāṃ sarvāneva sa nindati।
ekaṃ praśaṃsamānastu
sarvāneva praśaṃsati।
ekaṃ yo vetti puruṣaṃ
tamāhurbrahmavādinam।। 114।।
He who censures one among them censures all. He who eulogises one,
eulogises all of them. They declare him as Brahmavadin (propounder of
Brahman) who understands one Purusa.
But in both cases speaker of those verses is Suta not Lord Shiva and Suta explains "Race of Dharma" in those chapters.