Skip to content

Run a batch script with CLI commands with Delegated Permissions #1767

Answered by garrytrinder
Phentrin asked this question in General
Discussion options

You must be logged in to vote

You can pass the username and password of an account to authenticate with, into the o365 login command as shown below.

o365 login --authType password --userName [email protected] --password pass@word1

This will not prompt for authentication and will enable you to use Delegated Permissions; however, the account that you use must have MFA disabled.

If disabling MFA is not an option for you, we would recommend that you login to Office 365 CLI using the Certificate option, or if your Linux machine is hosted in Azure you can use Managed Identity. As both authentication types do not execute commands in the context of a user, they only support Application Permissions.

We currently do not support …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Phentrin
Comment options

@garrytrinder
Comment options

Answer selected by Phentrin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants