我遇到了这个问题,找不到任何答案。问题是我试图使用 Azure cdmlets 通过 c# 代码连接到 O365,但我无法获得connect-msolservice
.
“当您尝试在 Office 365 中运行管理 Windows PowerShell cmdlet 时出现“无法识别术语”错误”
我遇到了这个问题,找不到任何答案。问题是我试图使用 Azure cdmlets 通过 c# 代码连接到 O365,但我无法获得connect-msolservice
.
“当您尝试在 Office 365 中运行管理 Windows PowerShell cmdlet 时出现“无法识别术语”错误”
在查看了 Microsoft 的 TechNet 文章“Azure Active Directory Cmdlets”->“安装 Azure AD 模块”部分后,似乎这个过程已经大大简化,谢天谢地。
自 2016/06/30 起,为了成功执行 PowerShell 命令Import-Module MSOnline
和Connect-MsolService
,您需要安装以下应用程序(仅限 64 位):
7.250.4556.0
最新)msoidcli_64.msi
D077CF49077EE133523C1D3AE9A4BF437D220B16D651005BBC12F7BDAD1BF313
AdministrationConfig-en.msi
3.0
以后的版本可能也可以使用)Windows6.1-KB2506143-x64.msu
经过几个小时的搜索和尝试,我发现在 x64 服务器上必须为 x64 安装 MSOnline 模块,并且一些需要运行它们的程序使用的是 x86 PS 版本,所以他们永远找不到它。
[解决方案] 我为解决这个问题所做的是:
从源复制调用的文件MSOnline
夹MSOnline Extended
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\
到文件夹
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\
然后在 PS 中运行Import-Module MSOnline
,它会自动获取模块:D
我正在使用更新版本的 SPO 命令行管理程序。为了让错误消失,我将 Import-Module 语句更改为使用:
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking;
我还使用较新的命令:
Connect-SPOService
将 32 位库复制到 64 位的解决方案对我不起作用。有效的是取消选中项目属性中的 Target Platform Prefer 32-bit 复选标记。
在一个易于使用的脚本中连接到 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
需要以下内容:
资料来源: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
希望这会更好,可以节省一些人的时间