简体   繁体   English

此计算机上未安装PSSnapin Microsoft.Sharepoint.Powershell

[英]PSSnapin Microsoft.Sharepoint.Powershell is not installed on this computer

When I try to run the command Add-PSSnapin Microsoft.SharePoint.Powershell in SharePoint Online Management Shell 当我尝试在SharePoint Online Management Shell中运行Add-PSSnapin Microsoft.SharePoint.Powershell命令时

I get the following error: 我收到以下错误:

Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.Powershell` is not installed on this computer

+ CategoryInfo: InvalidArgument: (Microsoft.SharePoint.Powershell:string) [Add-PSSnapin], PSArgumentException

From what I understand this is supposed to come installed with SharePoint Online Management Shell anyway (this is a fresh download) so why won't it let me install it 根据我的理解,无论如何都应该安装SharePoint Online Management Shell(这是一个全新的下载)所以为什么它不能让我安装它

I can login to Sharepoint using the $AdminURL, $AdminName & $Password so it's not the end of the world (and proves that this should work), but obviously makes the script less easy to run across sites as it has to be modified everytime to change the url and adminname 我可以使用$ AdminURL,$ AdminName和$ Password登录Sharepoint,因此它不是世界末日(并证明这应该可行),但显然使脚本不易跨站点运行,因为每次都必须修改它更改网址和管理员名称

EDIT: I read on another post that adding this module (not snapin) would fix my issue of the error Get-SPSite is not recognized as the name of a cmdlet, function, script file, or operable program and Get-SPWebApplication is not recognized as the name of a cmdlet, function, script file, or operable program However, this did not fix my problem... 编辑:我在另一篇文章中读到,添加此模块(不是snapin)将解决我的错误问题Get-SPSite is not recognized as the name of a cmdlet, function, script file, or operable program Get-SPWebApplication is not recognized as the name of a cmdlet, function, script file, or operable program然而,这并没有解决我的问题...

As mentioned by user @kuzimoto the commands I was using were not compatible with SharePoint Online and were designed to be used in conjunction with SharePoint Server. 正如用户@kuzimoto所提到的,我使用的命令与SharePoint Online不兼容,并且旨在与SharePoint Server结合使用。

The correct way to connect is using the command Connect-SPOService and passing through the credentials through there or just have them hard coded into your script. 正确的连接方式是使用Connect-SPOService命令并通过那里传递凭据,或者将它们硬编码到您的脚本中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 此计算机上未安装 Windows PowerShell 管理单元“Microsoft.Sharepoint.Powershell”? - Windows PowerShell snap-in 'Microsoft.Sharepoint.Powershell' is not installed on this computer? Powershell错误Add-PSSnapin“ Microsoft.SharePoint.PowerShell” - Powershell error Add-PSSnapin “Microsoft.SharePoint.PowerShell” Add-PSSnapin'Microsoft.SharePoint.PowerShell'在ISE中运行,但不是从.Net Process.Start命令运行 - Add-PSSnapin 'Microsoft.SharePoint.PowerShell' runs in ISE but not from .Net Process.Start command 使用 Powershell 将文件上传到 Sharepoint Online (Microsoft 365)(选项 2 - 使用 Microsoft.SharePoint.PowerShell) - Upload file to Sharepoint Online (Microsoft 365) using Powershell (Option 2 - Using Microsoft.SharePoint.PowerShell) Visual Code和PowerShell 5.1无法加载SharePoint 2013 PsSnapin - Visual Code and PowerShell 5.1 Not Loading SharePoint 2013 PsSnapin TFS Build:此计算机上未安装`Microsoft.TeamFoundation.PowerShell' - TFS Build: `Microsoft.TeamFoundation.PowerShell' is not installed on this computer 无法将pssnapin microsoft.exchange.management.powershell.admin添加到Powershell Studio脚本 - Unable to add-pssnapin microsoft.exchange.management.powershell.admin to powershell studio script Powershell:IIS,Microsoft.Web.Administration,导入模块WebAdministration,PSSnapin WebAdministration - Powershell: IIS, Microsoft.Web.Administration, Import-Module WebAdministration, PSSnapin WebAdministration 无法为Microsoft.TeamFoundation.PowerShell添加PSSnapin,获取与无法投射对象有关的错误 - Unable to add PSSnapin for Microsoft.TeamFoundation.PowerShell getting error related to unable to cast object 如何解决Add-PSSnapin Microsoft.TeamFoundation.PowerShell和Get-TfsChildItem错误? - How to resolve the Add-PSSnapin Microsoft.TeamFoundation.PowerShell and Get-TfsChildItem error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM