20

我遇到了这个问题,找不到任何答案。问题是我试图使用 Azure cdmlets 通过 c# 代码连接到 O365,但我无法获得connect-msolservice.

“当您尝试在 Office 365 中运行管理 Windows PowerShell cmdlet 时出现“无法识别术语”错误”

4

6 回答 6

61

在查看了 Microsoft 的 TechNet 文章“Azure Active Directory Cmdlets”->“安装 Azure AD 模块”部分后,似乎这个过程已经大大简化,谢天谢地。

自 2016/06/30 起,为了成功执行 PowerShell 命令Import-Module MSOnlineConnect-MsolService,您需要安装以下应用程序(仅限 64 位):

  1. 适用操作系统:Windows 7 至 10
    名称:“Microsoft Online Services Sign-in Assistant for IT Professionals RTW”
    版本:(7.250.4556.0最新)
    安装程序 URL:https ://www.microsoft.com/en-us/download/details.aspx ?id=41950
    安装程序文件名:msoidcli_64.msi
  2. 适用操作系统:Windows 7 到 10
    名称:“Windows Azure Active Directory Module for Windows PowerShell”
    版本:未知,但最新安装程序文件的 SHA-256 哈希为D077CF49077EE133523C1D3AE9A4BF437D220B16D651005BBC12F7BDAD1BF313
    Installer URL:https ://technet.microsoft.com/en-us/ library/dn975125.aspx
    安装程序文件名:AdministrationConfig-en.msi
  3. 适用操作系统:仅限
    Windows 7 名称:“Windows PowerShell 3.0”
    版本:(3.0以后的版本可能也可以使用)
    安装程序 URL:https
    ://www.microsoft.com/en-us/download/details.aspx?id=34595 安装程序文件名:Windows6.1-KB2506143-x64.msu

 

在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

于 2013-08-22T15:33:37.503 回答
25

经过几个小时的搜索和尝试,我发现在 x64 服务器上必须为 x64 安装 MSOnline 模块,并且一些需要运行它们的程序使用的是 x86 PS 版本,所以他们永远找不到它。

[解决方案] 我为解决这个问题所做的是:

从源复制调用的文件MSOnlineMSOnline Extended

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

到文件夹

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

然后在 PS 中运行Import-Module MSOnline,它会自动获取模块:D

于 2013-04-15T15:12:03.890 回答
1

我正在使用更新版本的 SPO 命令行管理程序。为了让错误消失,我将 Import-Module 语句更改为使用:

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking;

我还使用较新的命令:

Connect-SPOService

于 2017-06-29T18:54:03.717 回答
1

将 32 位库复制到 64 位的解决方案对我不起作用。有效的是取消选中项目属性中的 Target Platform Prefer 32-bit 复选标记。

于 2017-03-10T18:09:25.103 回答
0

在一个易于使用的脚本中连接到 Office 365 和 Exchange Online。

提醒:您必须安装以下内容才能通过 PowerShell 管理 Office 365。

Microsoft 在线服务登录助手: http: //go.microsoft.com/fwlink/ ?LinkId=286152

适用于 Windows PowerShell 32 位的 Azure AD 模块 - http://go.microsoft.com/fwlink/p/?linkid=236298 64 位 - http://go.microsoft.com/fwlink/p/?linkid=236297

更多信息在这里: http ://technet.microsoft.com/en-us/library/hh974317.aspx

于 2015-12-10T19:22:38.180 回答
-2

需要以下内容:

  • 需要下载并安装 MS 在线服务助手。
  • 需要下载并安装适用于 PowerShell 的 MS 在线模块
  • 在 PowerShell 中连接到 Microsoft Online

资料来源:http ://www.msdigest.net/2012/03/how-to-connect-to-office-365-with-powershell/

如果您正在运行 64 位计算机,请按照此操作:我目前正在运行 x64 操作系统(Win8 Pro)。

从 (1) –> (2) 复制文件夹 MSOnline,如下所示

1) C:\Windows\System32\WindowsPowerShell\v1.0\Modules(MSOnline)

2) C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules(MSOnline)

资料来源: http: //blog.clauskonrad.net/2013/06/powershell-and-c-cant-load-msonline.html

希望这会更好,可以节省一些人的时间

于 2014-10-20T04:09:04.417 回答