Cannot connect using Connect-EXOPSSession

Dear Experts,

After following this instruction from Microsoft to how to install and use Exchange Online Powershell with MFA:
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps
When I try the first command, which is:

Connect-EXOPSSession   -UserPrincipalName   yballan@yyyy.org

I receive the following error message:

Import-Module : The specified module 'Microsoft.Exchange.Management.ExoPowershellModule.dll' was not loaded because no valid module file was found in any module directory.

I have verified that there are indeed folders and files in what follows the error message:  C:\Users\yballan\AppData\Local\Apps\2.0\2TY3WBGZ.L3B\H6W6HB8Z.OK0

I am not sure why the module cannot be found.  
I have deleted the C:\Users\yballan\AppData\Local\Apps\2.0 folder and the short cut to Online Exchange Powershell and redownloaded and reinstalled several times, but I still cannot get this working.
Please advise.
yballanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FOXActive Directory/Exchange EngineerCommented:
Yballan,
Did you go to your Exchange Admin Center for your site and download and install the Exchange online Module?

In Internet Explorer or Edge, open the Exchange admin center (EAC) for your Exchange Online organization (Google Chrome or Mozilla Firefox won't work). For instructions, see Exchange Admin Center in Exchange Online.

In the EAC, go to Hybrid > Setup and click the appropriate Configure button to download the Exchange Online Remote PowerShell Module for multi-factor authentication.
0
yballanAuthor Commented:
Dear FOX, yes, I did download and install the Exchange online Module.
First I thought the problem was that I was not executing it as Administrator.  But there is no way for me to do it.
Only thing I can find is a shortcut, cannot find where the executable is located.
Please see my screenshot.

I am executing everything in this module, and still getting an error.
MSEOP-Screenshot.jpg
0
Jian An LimSolutions ArchitectCommented:
try this on a normal powershell (prefered with admin rights)


Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)
$EXOSession = New-ExoPSSession
Import-PSSession $EXOSession

Open in new window

0
Redefine Your Security with AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Check out our on-demand webinar to learn more about how AI can help your organization!

yballanAuthor Commented:
Dear Jian An Lim, thank you for a quick reply.  When I execute the first line, I get an error.  Please see attached.
EXOPScriptError.JPG
0
Jian An LimSolutions ArchitectCommented:
can you do the following?

((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)

Open in new window


if the above failed. then we do the next one

(Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName

Open in new window


if basically all the result return null. then i just wonder where is your Microsoft.Exchange.Management.ExoPowershellModule.dll located?

paste a command prompt version of it will be good.


also want to know your powershell version by typing the following command

$PSVersionTable

Open in new window


mine was 5.1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yballanAuthor Commented:
Thank you, Jian An, I will perform the above as soon as I get to work tomorrow AM!!!!
0
Jian An LimSolutions ArchitectCommented:
also run

$env:LOCALAPPDATA

Open in new window


to confirm is this the same location on where your command prompt runs.

i am thinking you might use a different a admin account for powershell purpose hence cannot find the required dll
0
yballanAuthor Commented:
Yes, I was able to run all of the commands without error.  Please see attached.

Both Get-ChildItem -Path did not give error, but also did not return anything.  is that what you are referring as Null?

I agree with you, I have been trying to locate Microsoft.Exchange.Management.ExoPowershellModule.dll myself.  I am trying to see who has this info.
PowerShell.JPG
0
yballanAuthor Commented:
Dear Jian An,

When I went to find out who set this up, I was told one piece of information I was missing:  It doesn't run on Windows 7 Pro machine!!
I had no idea, since Win7 P laptop was what was given to me from my boss, I didn't even think to check.  I feel so dumb.

Thank you for guiding me to the right path, I RDP to Win2012 Server and tested and was able to get it working.

I really appreciated your help.
0
yballanAuthor Commented:
I really appreciated your help!  Thank you.   yballan
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.