The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Multi-Factor Authentication!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Exchange Online Powershell commands with MFA enabled module RRS feed

  • Question

  • Is there any C# example for this with C# runspaces created for MFA enabled powershell module?

    For running MFA enabled we need to run the command Connect-EXOPSSession -UserPrincipalName chris@contoso.com  , does the user Chris in above needs MFA enabled?

    what if we can use the Cloud Powerhsell does this gets charged from the azure tenant configured ? is there any sample available for running from cloud powershell

    there is sample available for powershell same when used in C# with Import-Module on windows powershell this doesn't execute Get-Mailbox command lets 

    is there any better way of performing this though C# or Do we need to wait for any further updates on this 

    Since Microsoft has planned to end Basic Authentication in Exchange Online from Oct 13, 2020 how can we use oAuth2.0 or MFA enabled powershell module please share any samples to follow 

    https://gallery.technet.microsoft.com/Connect-to-Exchange-Online-7d7365e0?ranMID=24542&ranEAID=je6NUbpObpQ&ranSiteID=je6NUbpObpQ-GNAGwL8QWE9MSJ5bNTC5IQ&epi=je6NUbpObpQ-GNAGwL8QWE9MSJ5bNTC5IQ&irgwc=1&OCID=AID2000142_aff_7593_1243925&tduid=(ir__zs2noiqieskfrjuzkk0sohzz0n2xgj1epmbwvn2e00)(7593)(1243925)(je6NUbpObpQ-GNAGwL8QWE9MSJ5bNTC5IQ)()&irclickid=_zs2noiqieskfrjuzkk0sohzz0n2xgj1epmbwvn2e00


    Arathi


    Wednesday, October 23, 2019 5:26 AM

All replies

  • Thank you for moving to right forum

    can we use the Graph calls OAuth2.0 to perform same operation as Get-Mailbox commandlet does


    Arathi

    Wednesday, October 23, 2019 10:55 AM
  • Hello Arathij,

    For running MFA enabled we need to run the command Connect-EXOPSSession-UserPrincipalNamechris@contoso.com, does the user Chris in above needs MFA enabled?

    No, the user does not necessarily need to have MFA Enabled.

    what if we can use the Cloud Powerhsell does this gets charged from the azure tenant configured ? is there any sample available for running from cloud powershell

    Yes, the Cloud Powershell is a chargeable as it creates a Storage space in the Subscription.

    Even though the Basic Authentication would be getting deprecated, the script that you are referring to uses Modern Authentication.

    Suggest you to to this url <https://outlook.office365.com/ecp/> and login with the Admin Credentials and on the left side select HYBRID

    Install the Exchange Online Powershell Module to support MFA.

    Then you can run the script that you have mentioned and the user would be directed for MFA challenge as it uses Modern Authentication with oAUTH 2.0

    Hope this helps.

    -----------------------------------------------------------------------------------------
    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


    Thursday, October 24, 2019 5:47 AM
    Moderator
  • Hi Neelesh 

    Thanks for reply this helps. Few more clarifications and queries from my side

    is there Graph calls coming on way before October 2020 from MS before  basic authentication gets retired?
    meaning exchange online operations though Graph call instead of command lets?

    Secondly I have an C# application where I create a runspacepool and execute the commands for which I might have to ask user to first install the MFA powerhsell module and 
    load it though code and execute exchange operations ? and  will fail if the MFA powershell module is not installed.  

    Manual installation of MFA powerhsell module and perform exchange operations, will it be chargeable? 

    please share sample or way to connect to online MFA powershell module any referring link(s)  is fine.

    Thanks, 
    Arathi



    • Edited by Arathij Thursday, October 24, 2019 11:05 AM
    Thursday, October 24, 2019 10:58 AM