Home > Enterprise >  Is there any way to connect the different services of O365 with single MFA crednetial through powers
Is there any way to connect the different services of O365 with single MFA crednetial through powers

Time:02-05

I have made one script in which i need to connect the connect-exchangeonline and connect-msolservice. I am using the MFA credential to connect these services

Is there anyway where we can connect these two services with single credential or can we save the MFA credential in variable from where we can use to connect both services?

Thanks in advance

CodePudding user response:

Microsoft says you can use:

$acctName="<UPN of the account, such as [email protected]>"
$orgName="<for example, litwareinc for litwareinc.onmicrosoft.com>"
#Azure Active Directory
Connect-MsolService
#Exchange Online
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName $acctName -ShowProgress $true
  •  Tags:  
  • Related