使用Powershell创建文档集图标(/_layouts/15/images/icdocset.gif")时,转到文件夹图标(/_layouts/15/images/folder.gif) [英] Document Set Icon (/_layouts/15/images/icdocset.gif") turn to Folder Icon (/_layouts/15/images/folder.gif) when creating using Powershell
问题描述
我正在尝试使用PowerShell创建文档集,我可以使用脚本创建文档集,但文档夹图标显示在文档上套。
请问你能帮我解释默认文件集图标转向文件夹图标的原因吗?
有没有属性我在运行脚本时需要强制吗?
PS我运行用于创建文档集的脚本的站点是使用站点配置工作者角色创建的自定义网站集。
如果我在开箱即用的网站上运行脚本租户然后图标正确显示。
任何帮助?
谢谢
Aman
您能否检查文档集项目的ProgId属性。
以下是关于类似情况的一个主题。
提示:线程中共享的脚本可以仅在服务器端使用,如果您在线使用SharePoint,请改用CSOM。
示例代码:
static void Main(string [] args)
{
string login =" lee@domain.onmicrosoft.com" ;; //在此处提供您的用户名
string password =" pw" ;; //提供密码
var securePassword = new SecureString();
foreach(密码中的字符)
{
securePassword.AppendChar(c);
}
string siteUrl =" https://domain.sharepoint.com/sites/developer" ;;
using(ClientContext context = new ClientContext(siteUrl))
{
context.Credentials = new SharePointOnlineCredentials(login,securePassword);
Microsoft.SharePoint.Client.List myList = context.Web.Lists.GetByTitle(" MyDoc");
var item = myList.GetItemById(33);
context.Load(item);
context.ExecuteQuery();
Console.WriteLine(item.FieldValues [" ProgId"]);
Console.WriteLine(" done");
}
Console.ReadLine();
}
最好的问候,
Lee < /跨度>
Hi,
I am trying to create document set using powershell, I am able to create the Document Set using script, however Folder icon is showing up on Document sets.
Please can you help me the reason why the default document set icon is turning to a folder icon?
Is there any property that i need to force while running the script ?
P.S. The site where i am running the script to create document set is a custom site collection created using a site provisioning worker role.
If i run the script on out of box site created from tenant then icons are showing up correctly.
Any help ?
Thank you
Aman
Hi,
Could you check the ProgId property for the document set item.
Here is one thread disscuss about the similar case.
Tip: the script shared in thread can be used in server side only, if you’re using SharePoint online, use CSOM instead.
Sample code:
static void Main(string[] args) { string login = "lee@domain.onmicrosoft.com"; //give your username here string password = "pw"; //give your password var securePassword = new SecureString(); foreach (char c in password) { securePassword.AppendChar(c); } string siteUrl = "https://domain.sharepoint.com/sites/developer"; using (ClientContext context = new ClientContext(siteUrl)) { context.Credentials = new SharePointOnlineCredentials(login, securePassword); Microsoft.SharePoint.Client.List myList = context.Web.Lists.GetByTitle("MyDoc"); var item = myList.GetItemById(33); context.Load(item); context.ExecuteQuery(); Console.WriteLine(item.FieldValues["ProgId"]); Console.WriteLine("done"); } Console.ReadLine(); }
Best Regards,
Lee
这篇关于使用Powershell创建文档集图标(/_layouts/15/images/icdocset.gif")时,转到文件夹图标(/_layouts/15/images/folder.gif)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!