【问题标题】:How to get CorporateCatalogUrl url using csom如何使用 csom 获取 CorporateCatalogUrl url
【发布时间】:2021-07-05 08:01:55
【问题描述】:

我想使用 CSOM 获取租户 CorporateCatalogUrl 。我尝试了以下代码并没有用。我也不确定这是正确的方法。有没有办法使用 CSOM 获取 CorporateCatalogUrl ?

using (ClientContext context = new ClientContext("https://abc-admin.sharepoint.com"))
                {
                    context.ExecutingWebRequest += delegate (object sender, WebRequestEventArgs e)
                    {
                        e.WebRequestExecutor.WebRequest.Headers.Add("Authorization", "Bearer " + AccessToken);
                    }; 
           
                    var TenantSettings = Microsoft.SharePoint.Client.TenantSettings.GetCurrent(context);                       
                    context.Load(TenantSettings);
                    context.ExecuteQueryRetry();   
                }

【问题讨论】:

    标签: sharepoint csom spfx-extension


    【解决方案1】:

    我使用SharePointOnlineCredentials(name, securePassword); 进行身份验证,我可以得到租户 CorporateCatalogUrl,如下图所示。如果您使用访问令牌,请确保您已授予必要的权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多