コード例 #1
0
        static void ExportFromO365(O365Service service)
        {
            try
            {
                Logger.Debug($"Starting Export from {service}");

                WriteToConsole($"O365 Tenant name [e.g. \"Contoso\", from {{contoso}}.onmicrosoft.com]: ");
                var tenantName = ReadFromConsole();

                WriteToConsole($"O365 Administrator username [e.g. [email protected]]: ");
                var username = ReadFromConsole();

                WriteToConsole($"O365 Administrator password: "******"Tenant: {tenantName}");
                Logger.Debug($"Username: {username}");

                var settings = new O365Settings()
                {
                    Username   = username,
                    Password   = password,
                    TenantName = tenantName
                };

                Logger.Debug($"Initializing O365 worker");

                var worker = new O365Worker(settings);

                var newPeopleList = worker.Export(service);

                // merge
                MergeAndSavePeopleLists(newPeopleList);

                Logger.Debug($"Completed export from {service}");

                WriteToConsole();
                WriteToConsole($"Completed export of photos. Press any key to return to main menu.");
                ReadFromConsole();
            }
            catch (Exception e)
            {
                WriteToConsole($"Problem exporting: {e.Message}");
                WriteToConsole("Press any key to continue");
                var input = ReadFromConsole();
            }
        }
コード例 #2
0
 public O365Worker(O365Settings o365Settings)
 {
     _o365 = new O365Client(o365Settings);
 }