I referred this link and it explain how to connect using client and secret.
But, I cannot use this in production environment as the PowerShell script is going to store in the server. Anyone can open it and see the creds.
Could you please kindly explain me how to use a certificate instead of client and secret to connect Azure AD and extract users last log in information without any user interaction or MFA prompts with pop-up windows.
Thanks