csharp Criando MySites没有SharePoint Online - 通过CSOM的Office 365。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp Criando MySites没有SharePoint Online - 通过CSOM的Office 365。相关的知识,希望对你有一定的参考价值。

/*
Microsoft.Online.SharePoint.Client.Tenant.dll v16.0.2617.1200
Microsoft.SharePoint.Client.dll v16.0.2617.1200
Microsoft.SharePoint.Client.Runtime.dll v16.0.2617.1200
Microsoft.SharePoint.Client.UserProfiles.dll v16.0.2617.1200
*/

static void Main(string[] args)
{
  string adminSiteUrl = "https://site-admin.sharepoint.com";
  string username = "admin@site.onmicrosoft.com";
  string password = "******";
  string[] emailIDs = { "user@site.onmicrosoft.com" };
                  
  SecureString SecurePassword = new SecureString();
  foreach (char c in password.ToCharArray())
  {
      SecurePassword.AppendChar(c);
  }
  CreatePersonalSiteCSOM(adminSiteUrl, username, SecurePassword, emailIDs);
}

static void CreatePersonalSiteCSOM(string tenantAdminUrl, string userName, SecureString securePassword, string[] emailIdCollection)
{            
    //Microsoft.SharePoint.Client.UserProfiles
    using (ClientContext adminContext = new ClientContext(tenantAdminUrl))
    {
        try
        {
            SharePointOnlineCredentials SPOCreds = new SharePointOnlineCredentials(userName, securePassword);
            adminContext.Credentials = SPOCreds;
            adminContext.ExecuteQuery();

            Microsoft.SharePoint.Client.UserProfiles.ProfileLoader pLoader = ProfileLoader.GetProfileLoader(adminContext);
            pLoader.CreatePersonalSiteEnqueueBulk(emailIdCollection);
            pLoader.Context.ExecuteQuery();
        }
        catch (Exception ex)
        {
            throw;
        }
    }
}

以上是关于csharp Criando MySites没有SharePoint Online - 通过CSOM的Office 365。的主要内容,如果未能解决你的问题,请参考以下文章

text Criando Tipo查询没有graphql

php Criando suas没有Codeigniter

text Criando tipo enum没有graphql

javascript criando下标graphql

powershell Criando服务申请做国家服务

javascript Criando变异e解析器graphql