Reputation: 628
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"
Upvotes: 21
Views: 185785
Reputation: 427
I'm using a newer version of the SPO Management Shell. For me to get the error to go away, I changed my Import-Module statement to use:
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking;
I also use the newer command:
Connect-SPOService
Upvotes: 1
Reputation: 21
The solution with copying 32-bit libs over to 64-bit did not work for me. What worked was unchecking Target Platform Prefer 32-bit check mark in project properties.
Upvotes: 2
Reputation: 3782
After reviewing Microsoft's TechNet article "Azure Active Directory Cmdlets" -> section "Install the Azure AD Module", it seems that this process has been drastically simplified, thankfully.
As of 2016/06/30, in order to successfully execute the PowerShell commands Import-Module MSOnline
and Connect-MsolService
, you will need to install the following applications (64-bit only):
7.250.4556.0
(latest)msoidcli_64.msi
D077CF49077EE133523C1D3AE9A4BF437D220B16D651005BBC12F7BDAD1BF313
AdministrationConfig-en.msi
3.0
(later versions will probably work too)Windows6.1-KB2506143-x64.msu
Upvotes: 61
Reputation: 628
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
Upvotes: 25
Reputation: 661
Connects to both Office 365 and Exchange Online in one easy to use script.
REMINDER: You must have the following installed in order to manage Office 365 via PowerShell.
Microsoft Online Services Sign-in Assistant: http://go.microsoft.com/fwlink/?LinkId=286152
Azure AD Module for Windows PowerShell 32 bit - http://go.microsoft.com/fwlink/p/?linkid=236298 64 bit - http://go.microsoft.com/fwlink/p/?linkid=236297
MORE INFORMATION FOUND HERE: http://technet.microsoft.com/en-us/library/hh974317.aspx
Upvotes: 0
Reputation: 1040
The following is needed:
Source: http://www.msdigest.net/2012/03/how-to-connect-to-office-365-with-powershell/
Then Follow this one if you're running a 64bits computer: I’m running a x64 OS currently (Win8 Pro).
Copy the folder MSOnline from (1) –> (2) as seen here
1) C:\Windows\System32\WindowsPowerShell\v1.0\Modules(MSOnline)
2) C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules(MSOnline)
Source: http://blog.clauskonrad.net/2013/06/powershell-and-c-cant-load-msonline.html
Hope this is better and can save some people's time
Upvotes: -2