Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
malik:56-23Mālik > Ismāʿīl b. Abū Ḥakīm > ʿUmar b. ʿAbd al-ʿAzīz

Malik related to me that Ismail ibn Abi Hakim heard Umar ibn Abd al-Aziz say, "Some say that Allah the Blessed, the Exalted, will not punish the many for the wrong action of the few. However, when the objectionable action is committed openly, then they all deserve to be punished."  

مالك:٥٦-٢٣وَحَدَّثَنِي مَالِكٌ عَنْ إِسْمَاعِيلَ بْنِ أَبِي حَكِيمٍ أَنَّهُ سَمِعَ عُمَرَ بْنَ عَبْدِ الْعَزِيزِ

يَقُولُ كَانَ يُقَالُ إِنَّ اللَّهَ تَبَارَكَ وَتَعَالَى لاَ يُعَذِّبُ الْعَامَّةَ بِذَنْبِ الْخَاصَّةِ وَلَكِنْ إِذَا عُمِلَ الْمُنْكَرُ جِهَارًا اسْتَحَقُّوا الْعُقُوبَةَ كُلُّهُمْ  


See similar narrations below:

Collected by Aḥmad's Zuhd
ahmad-zuhd:1704ʿAbdullāh > Muṣʿab b. ʿAbdullāh al-Zubayrī > Mālik > Ismāʿīl b. Abū Ḥakīm > ʿUmar b. ʿAbd al-ʿAzīz

[Machine] It is said that Allah does not punish the general public for the sins of individuals, but when a great wrongdoing is committed openly, they all deserve the punishment.  

الزهد لأحمد:١٧٠٤حَدَّثَنَا عَبْدُ اللَّهِ حَدَّثَنَا مُصْعَبُ بْنُ عَبْدِ اللَّهِ الزُّبَيْرِيُّ حَدَّثَنِي مَالِكٌ عَنْ إِسْمَاعِيلَ بْنِ أَبِي حَكِيمٍ أَنَّهُ أَخْبَرَهُ أَنَّهُ سَمِعَ عُمَرَ بْنَ عَبْدِ الْعَزِيزِ يَقُولُ كَانَ

يُقَالُ إِنَّ اللَّهَ لَا يُعَذِّبُ الْعَامَّةَ بِذَنْبِ الْخَاصَّةِ وَلَكِنْ إِذَا عُمِلَ الْمُنْكَرُ جِهَارًا اسْتَحَقُّوا الْعُقُوبَةَ كُلُّهُمْ