是否有任何API可以返回给定输入路径的内容类型(文档库或图片库等) [英] Is there any API which can return the type of content(Document Library or Picture Library etc) for a given input path

查看:82
本文介绍了是否有任何API可以返回给定输入路径的内容类型(文档库或图片库等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们要求我们提取文档库,子网站,文件夹和文件的信息(元数据)。此外,我们正在获取最重要的审计信息。


现在问题是我们不需要图片库,因此在获取元数据信息(即扫描)时我们得到的类型即文档库或图片库。 因此,我们可以轻松跳过这些内容,但在获取审核日志时,我们没有获得任何特定的
字段,这将有助于我们识别其类型。



所以我们的计划是再使用一些其他api进行一次调用,这将返回给定输入路径的确切类型。


是否有这样的api?


如果没有,我们可以使用任何其他方式来识别图片库,以便我们可以从收到的审核信息中排除这些



我们使用PowerShell脚本来获取审计信息。





谢谢,


Jaydeep


解决方案

嗨JaydeepS,


根据我的测试,假设您使用的是SharePoint Online,图片库和文档库的基本类型都是"文档库"。因此,我们无法检查基本类型以区分它是文档库还是图片库。


 解决方法是我们需要检查库标题,如果它等于某些诸如"pic1"之类的字符。哪个代表图片库,然后我们可以排除它,这里有一个演示供您参考:

 Add-Type -Path" C: \Program Files \Common Files \ Mysoftoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" 
Add-Type -Path" C:\Program Files \Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Variables for Processing


SiteUrl =" https://tenant.sharepoint.com/sites/sitename"


< BLOCKQUOTE>用户名= QUOT; user@tenant.onmicrosoft.com"

Hi ,

We have a requirement in which we are fetching the information (meta data) of Document libraries, Subsites ,folders and files. Also we are fetching audit information of above all.

Now problem is we don't need Picture Libraries, So while fetching the meta data information (i.e scanning) we get the type i.e. Document Library or Picture Library.  Hence we can easily skip those but while fetching the audit logs we don't get any specific field which will help us in identifying its type.

So our plan is to make one more call using some other api which will return what is the exact type for a given input path.

Is there any such api ?

Or if not are there any other ways we can use in order to identify the Picture library so that we can just exclude those from received audit information

We are using PowerShell Scripts for fetching audit information.


Thanks,

Jaydeep

解决方案

Hi JaydeepS,

Per my test, suppose you are using SharePoint Online, Both Picture Library and Documents Library's base type are "Document Library". So we can not check the base type to distinguish if this is a Document library or Picture Library.

 A workaround is that we then need to check the library title, if it equal some character such as "pic1" which stand for a Picture library, then we can exclude it, here is a demo for your reference:

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
   
#Variables for Processing


SiteUrl = "https://tenant.sharepoint.com/sites/sitename"


UserName="user@tenant.onmicrosoft.com"


这篇关于是否有任何API可以返回给定输入路径的内容类型(文档库或图片库等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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