Danny Fallas Danny Fallas - 3 months ago 54
PowerShell Question

MSOnline can't be imported on PowerShell (Connect-MsolService error)

I had this issue and couldnĀ“t find any answer. The issue was that I was trying to use Azure cdmlets to connect to O365 via c# code, but I couldnĀ“t get the

connect-msolservice
.


""The term is not recognized" error when you try to run administrative Windows PowerShell cmdlets in Office 365"

Answer

After hours of searching and trying I found out that on a x64 server the MSOnline modules must be installed for x64, and some programs that need to run them are using the x86 PS version, so they will never find it.

[SOLUTION] What I did to solve the issue was:

Copy the folders called MSOnline and MSOnline Extended from the source

C:\Windows\System32\WindowsPowerShell\v1.0\Modules\

to the folder

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\

And then in PS run the Import-Module MSOnline, and it will automatically get the module :D

Comments