The Messenger of Allah ﷺ said, "When Allah wills good for a ruler, He grants him an honest minister who reminds him when he forgets and supports him when he remembers. But when Allah wills otherwise for him, He grants him an evil minister who does not remind him when he forgets and does not support him when he remembers."
قال رسول الله ﷺ: إذا أراد الله بالأمير خيرا جعل له وزير صدق إن نسى ذكره، وإن ذكر أعانه، وإذا أراد الله به غير ذلك جعل له وزير سوء، إن نسى لم يذكره، وإن ذكر لم يعنه.
Reported by Abu Dawud (2932), and this is his wording, Nasai (4204), Ahmad (24414), Ibn Hibban (4494), and Bayhaqi (10/111-112), all of them through various routes from Qasim bin Muhammad, from Ayesha, who narrated it.Some of its routes contain slight daif, which is strengthened by its coming through other routes.