How to create powershell to schedule task script Connect-AzureAD without credentials- MFA enabled

Iron Contributor

Hi there,
I have created some scirpts in powershell to Get-AzureADGroup and Members but now i would like to schedule it.
The issue is we are using MFA and don't know what needs to be done to be able to write a script that would run successfully without having to get prompted to login.


Any ideas would be appreciated.
What are the options?


3 Replies
Your best bet would be to use the Graph API with 'application permissions'. This doesn't need an account, just an app registration.

Check out this blog =>

And the Graph API docs =>