在Windows 10 PC中运行Sharepoint PowerScript时找不到类型[Microsoft.SharePoint.SPSite] [英] Cannot find type [Microsoft.SharePoint.SPSite] when running Sharepoint PowerScript in a Windows 10 PC

查看:84
本文介绍了在Windows 10 PC中运行Sharepoint PowerScript时找不到类型[Microsoft.SharePoint.SPSite]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我想从LIST下载所有附件以进行本地备份。当我运行SP Powerscript时,第一个语句已经失败....



new-object:找不到类型[Microsoft.SharePoint。 SPSite]:验证是否加载了包含此类型的程序集。 ...。



在运行此脚本之前我需要安装什么?



提前致谢

解决方案


https://stackoverflow.com/questions/ 33534120 / connections-share-oniline-using-powershell-not-find-a-proper-c



似乎Assemblies未正确加载。

   [ 系统  反射  汇编 ] ::   LoadFile     " C:\ MOSSLibrary\Microsoft.SharePoint.Client.dll"      |    输出   -     
[ 系统 反射 汇编 ] :: LoadFile " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.Runtime.dll" | 输出 -



而不是上面,请尝试以下

  添加   -   类型     -   路径   " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.dll"   
添加 - 类型 - 路径 " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.Runtime.dll"



PS: 确保  C:\ MOSSLibrary \  包含
以下两个  .dll 's

   Microsoft    SharePoint   客户   dll 
Microsoft SharePoint 客户 运行时 DLL


Hi

I want to download all attachments from a LIST for local backup purpose. When I run a SP Powerscript, the first statement already failed....

new-object : Cannot find type [Microsoft.SharePoint.SPSite]: verify the assembly containing this type is loaded. ….

Anything I need to install before I can run this script ??

Thanks in advance

解决方案

https://stackoverflow.com/questions/33534120/connecting-to-sharepoint-oniline-using-powershell-cannot-find-an-appropriate-c

It seems Assemblies are not loading correctly.

[System.Reflection.Assembly]::LoadFile ("C:\MOSSLibrary\Microsoft.SharePoint.Client.dll") | Out-Null
[System.Reflection.Assembly]::LoadFile("C:\MOSSLibrary\Microsoft.SharePoint.Client.Runtime.dll") | Out-Null 

Instead of above, try following

Add-Type -Path "C:\MOSSLibrary\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\MOSSLibrary\Microsoft.SharePoint.Client.Runtime.dll"

PS: Make sure that C:\MOSSLibrary\ contains following two .dll's

Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll


这篇关于在Windows 10 PC中运行Sharepoint PowerScript时找不到类型[Microsoft.SharePoint.SPSite]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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