简体   繁体   English

什么是 Office 365 中的租户?

[英]What is Tenant in Office 365?

I'm new to Office 365 and SharePoint, while I'm trying to create a SharePoint site using CSOM in .NET I've used Tenant like (var tenant = new Tenant(clientContext);) can someone explain what "Tenant" exactly is and what is the use of it in here.我是 Office 365 和 SharePoint 的新手,当我尝试在 .NET 中使用 CSOM 创建 SharePoint 网站时,我使用了租户,例如 (var tenant = new Tenant(clientContext);) 有人可以解释一下什么是“租户”是以及它在这里的用途是什么。 When I searched for it I learnt something like Tenant ID which Unique for each Company, but Tenant ID and Tenant in CSOM is different right?当我搜索它时,我了解到每个公司都唯一的租户 ID 之类的东西,但是 CSOM 中的租户 ID 和租户是不同的,对吗? and also What is ClientContext?还有什么是ClientContext? in my code I have used both ClientContext and Tenant to create a SharePoint Site.在我的代码中,我使用 ClientContext 和 Tenant 创建了一个 SharePoint 站点。

using System;
using System.Security;
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
namespace CreateSiteCollections
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Program Started!");
            //Opens the Admin URL
            using(ClientContext tenantContext=new ClientContext("https://developer19-admin.sharepoint.com/"))
            {
                //Authenticating with Tenant Admin
                SecureString passWord = new SecureString();
                foreach (char c in "passCode1".ToCharArray())
                    passWord.AppendChar(c);
                tenantContext.Credentials = new SharePointOnlineCredentials("kailash@developer19.onmicrosoft.com", passWord);

                var tenant = new Tenant(tenantContext);

                //Properties
                var siteCreationProperties = new SiteCreationProperties();

                //New-Site URL
                siteCreationProperties.Url = "https://developer19.sharepoint.com/sites/codesite";

                //Titie of the Root Site
                siteCreationProperties.Title = "Coded Site";

                //Login Name
                siteCreationProperties.Owner = "kailash@developer19.onmicrosoft.com";

                //Template Copied from Team Site
                siteCreationProperties.Template = "STS#0";

                //Storage Limit in MB
                siteCreationProperties.StorageMaximumLevel = 100;

                //UserCode resourse Points Allowed
                siteCreationProperties.UserCodeMaximumLevel = 50;

                //Creates Site Collection
                SpoOperation spo = tenant.CreateSite(siteCreationProperties);

                tenantContext.Load(tenant);

                //IsComplete to check if provisioning is Completed
                tenantContext.Load(spo, i => i.IsComplete);

                tenantContext.ExecuteQuery();

                while(!spo.IsComplete)
                    {
                    //Waits 30 Sec and tries again
                    System.Threading.Thread.Sleep(30000);
                    spo.RefreshLoad();
                    tenantContext.ExecuteQuery();
                }
                Console.WriteLine("SiteCollection Created.");
            }
        }
    }
}

A Tenant is the Organisation or the Company.租户是组织或公司。 It's the "instance of Office 365" that is unique to your user base.它是您的用户群独有的“Office 365 实例”。

While it's not necessarily a single domain name, because a Tenant could have multiple domain names, that's one way to think of it.虽然它不一定是单个域名,因为租户可能有多个域名,但这是一种思考方式。

A tenancy in Office 365 refers to the full Office 365 suite attached to a domain. Office 365 中的租赁是指附加到域的完整 Office 365 套件。 When Office 365 is set up, it creates a tenancy to store all the data for Office 365 including things like SharePoint, OneDrive and Yammer.设置 Office 365 后,它会创建一个租户来存储 Office 365 的所有数据,包括 SharePoint、OneDrive 和 Yammer。 This allows all of your organisations data to sit in the same environment and be moved around within the tenant with ease.这允许您的所有组织数据位于同一个环境中,并且可以轻松地在租户内移动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM