无法在 PowerShell 上导入 MSOnline(Connect-MsolService 错误) [英] MSOnline can't be imported on PowerShell (Connect-MsolService error)

查看:26
本文介绍了无法在 PowerShell 上导入 MSOnline(Connect-MsolService 错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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

推荐答案

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

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:

从源代码中复制名为MSOnlineMSOnline Extended 的文件夹

Copy the folders called MSOnline and MSOnline Extended from the source

C:WindowsSystem32WindowsPowerShellv1.0Modules

C:WindowsSystem32WindowsPowerShellv1.0Modules

到文件夹

C:WindowsSysWOW64WindowsPowerShellv1.0Modules

C:WindowsSysWOW64WindowsPowerShellv1.0Modules

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

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

这篇关于无法在 PowerShell 上导入 MSOnline(Connect-MsolService 错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆