安裝 School Data Sync 工具組Install the School Data Sync Toolkit

注意

此工具組會推出已被取代。我們建議您將上傳您使用 SDS 流程連接器的 CSV 檔案。詳細的說明可找到CSV 檔案同步處理自動化This toolkit will be deprecated soon. We suggest you upload your CSV files using the SDS Flow Connector. Detailed instructions can be found at CSV File Sync Automation

您可以使用 School Data Sync 工具組來驗證 CSV 檔案和檢查錯誤、從 PowerShell 執行手動 CSV 同步,以及將 CSV 同步程序自動化以滿足需求。You can use the School Data Sync Toolkit to validate your CSV files and check for errors, perform a manual CSV sync from PowerShell, and automate the CSV sync process to meet your needs.

本主題內容:In this topic:

安裝 Microsoft School Data Sync 工具組Install the Microsoft School Data Sync Toolkit

  1. 下載此工具從Microsoft 學校資料同步處理工具組Download the tool from Microsoft School Data Sync Toolkit

  2. 按兩下工具以執行精靈。Double-click the tool to run the wizard.

  3. 在 [歡迎]**** 頁面上,選擇 [下一步]****。On the Welcome page, choose Next.

    在 Microsoft School Data Sync 工具組設定的 [歡迎] 頁面上選擇 [下一步]

  4. 接受授權合約 > 按 [下一步]****、選擇安裝路徑,然後再選擇 [下一步]****。Accept the license agreement > click Next, choose an installation path, and then choose Next.

    選擇 Microsoft School Data Sync 工具組的安裝路徑

  5. 選擇 [安裝] **** > [完成]****。Choose Install > Finish.

School Data Sync 工具組的功能Capabilities of the School Data Sync Toolkit

您已安裝 toolkit 和學校資料同步處理入口網站中已建立您的初始設定檔之後,您可以使用下列指令碼上傳額外的 CSV 檔案規則或做為所需的基礎。 安裝程式可讓您從系統 PowerShell 工作階段執行數個 cmdlet 在您的電腦,以協助您順利部署學校資料同步處理。請參閱下列各節說明及使用案例的每個指令程式。After you have installed the toolkit and your initial profile has been created in the School Data Sync Portal, you can use the following script to upload additional CSV files on a regular or as-needed basis. The installer allows you to run several cmdlets from an admin PowerShell session on your computer, to help you deploy School Data Sync successfully. See the following sections for a description and use case for each cmdlet.

注意

您需要安裝的檔案上傳 AzCopy 運作的特定版本。AZCopy 安裝程式的連結是此處You will need to install a specific version of AzCopy for the file uploads to work. The link to the AZCopy installer is here.

使用 School Data Sync 工具組來驗證 CSV 檔案資料 (預先同步)Use the School Data Sync Toolkit to validate CSV file data (Pre-sync)

若要在上傳同步處理所需的 CSV 檔案之前使用工具組來驗證檔案,請以系統管理員身分開啟 PowerShell,再依照以下語法和範例的描述使用 Start-CsvFilesValidation Cmdlet。To use the toolkit to validate CSV files before you upload the files for synchronization, open PowerShell as an Administrator and use the Start-CsvFilesValidation cmdlet as described by the following syntax and examples.

Start-CsvFilesValidation 語法Start-CsvFilesValidation syntax

使用 Start-CsvFilesValidation Cmdlet 來驗證指定同步處理設定檔的 CSV 檔案。Use the Start-CsvFilesValidation cmdlet to validate CSV files for a given sync profile.


Start-CsvFilesValidation -CsvFolderPath <String> -ProfileName <String> -UserName <String>
參數Parameter 描述Description
CsvFolderPathCsvFolderPath
包含 CSV 檔案的資料夾路徑。Path to the folder containing the CSV files.
ProfileNameProfileName
設定檔的名稱,該設定檔為您在 School Data Sync 中針對要驗證的 CSV 所建立。Name of the profile you've created in School Data Sync for the CSVs you want to validate.
UserNameUserName
系統管理員帳戶的使用者名稱,該帳戶擁有 Office 365 租用戶的全域管理員權限。User name of the admin account with Global admin rights for the Office 365 tenant.

以下範例會使用 admin@contoso.com 全域管理員帳戶,根據名為 School 1 的設定檔,針對位在本機電腦 c:\temp 目錄中的 CSV 檔案執行用戶端驗證。The following example performs client-side validation of CSV files located in the c:\temp directory of the local computer, for a profile called "School 1", using the global admin account of admin@contoso.com.

Start-CsvFilesValidation -CsvFolderPath "c:\\temp" -ProfileName "School 1" -UserName admin@contoso.com

使用 School Data Sync 工具組來同步處理 CSV 檔案Use the School Data Sync Toolkit to sync CSV files

若要利用 School Data Sync 上傳及同步處理 CSV 檔案,請以系統管理員身分開啟 PowerShell,再依照以下語法和範例的描述使用 Send-CsvFiles Cmdlet。To upload and sync CSV files with School Data Sync, open PowerShell as an Administrator and use the Send-CsvFiles cmdlet as described by the following syntax and example.

Send-CsvFiles 語法Send-CsvFiles syntax

使用 Send-CsvFiles Cmdlet 上傳及同步處理指定同步處理設定檔的 CSV 檔案。Use the Send-CsvFiles cmdlet to upload and sync CSV files for a given sync profile.


Send-CsvFiles -CsvFolderPath <String> -ProfileName <String> -UserName <String>
參數Parameter 描述Description
CsvFolderPathCsvFolderPath
包含 CSV 檔案的資料夾路徑。Path to the folder containing the CSV files.
ProfileNameProfileName
設定檔的名稱,該設定檔為您在 School Data Sync 中針對要驗證的 CSV 所建立。Name of the profile you've created in School Data Sync for the CSVs you want to validate.
UserNameUserName
系統管理員帳戶的使用者名稱,該帳戶擁有 Office 365 租用戶的全域管理員權限。User name of the admin account with Global admin rights for the Office 365 tenant.

以下範例會使用 admin@contoso.com 全域管理員帳戶,依據名為 School 1 的設定檔,上傳及同步處理一組位於本機電腦 c:\temp 目錄中的 CSV 檔案。The following example uploads and syncs a set of CSV files located in the c:\temp directory of the local computer, for a profile called "School 1", using the global admin account of "admin@contoso.com.


Send-CsvFiles -CsvFolderPath "c:\\temp" -ProfileName "School 1" -UserName "admin@contoso.com"

使用 School Data Sync 工具組來設定自動 CSV 同步Use the School Data Sync Toolkit to configure automated CSV sync

您可以排定無人看管的自動同步作業,以同步處理儲存在本機的 CSV 檔案和 Office 365 中的 SDS 同步處理設定檔。若要同步處理,請以系統管理員身分開啟 PowerShell,再依照以下語法和範例的描述使用 Add-CsvFileSyncTask Cmdlet。排程工作完成後,您可以在工作排程器中檢閱新建立的排程工作,藉此監控這些自動同步作業的進度和歷程記錄。除非您使用以下參數修改啟動時間,否則這項排程工作會在每天的午夜執行。You can schedule unattended automated syncs between your CSV files stored locally and your SDS Sync Profile in Office 365. To do this, open PowerShell as an Administrator and use the Add-CsvFileSyncTask cmdlet as described by the following syntax and examples. After the scheduled task is complete, you can monitor the progress and history of these automated syncs by reviewing the newly created scheduled task in Task Scheduler. This scheduled task will run daily at midnight, unless you modify the start time using the parameter below.

當您執行此命令時,系統會提示您進行驗證。第一項驗證提示會要求您提供全域管理員認證,其中已包含您在以下命令中,透過 username 參數指定的使用者名稱。當您輸入密碼並按下 Enter 後,系統會顯示第二個基本驗證提示。在這裡,您應該要輸入本機系統管理員的使用者名稱和密碼,也就是排程工作每天啟動時用來執行的認證。如果您加入 StoreCredentials 參數,系統會將本機系統管理員帳戶認證儲存在認證管理員中,只要您未更改密碼,認證就會持續生效。如果您未指定 StoreCredentials 參數,系統將會授與最長存留時間為 90 天的驗證權杖。驗證權杖到期後,您將無法在執行排程工作時進行驗證,此時您必須再執行命令一次。When you run this command, you will be prompted to authenticate. The first authentication prompt will require your Global Admin credentials and will already contain the username you specify in the command below, under the username parameter. After you enter your password and click Enter, you will then receive a second, basic authentication prompt. Here you should enter the local administrator username and password, which will be the credentials used to run the scheduled task, each time it starts daily. If you include the StoreCredentials parameter, the local administrator account credentials will be stored in Credential Manager, and continue to work as long as the password remains unchanged. If you do not specify the StoreCredentials parameter, you will be granted an auth token, which has a maximum lifetime of 90 days. This will require that you run the command again after the auth token expires and is no longer able to authenticate while running the scheduled task.

Add-CsvFileSyncTask 語法Add-CsvFileSyncTask syntax

使用 Add-CsvFileSyncTask Cmdlet 上傳及同步處理指定同步處理設定檔的 CSV 檔案。Use the Add-CsvFileSyncTask cmdlet to upload and sync CSV files for a given sync profile.


Add-CsvFileSyncTask -CSVFolderPath <path to csv file location> -ProfileName <name of sync profile in SDS> -LogPath <path to store logs> -UserName <global admin account> -Validate -RedirectOutput
參數Parameter 描述Description
CSVFolderPathCSVFolderPath
含有 CSV 檔案的資料夾路徑,系統將定期同步處理這些 CSV 檔案。Path to the folder containing the CSV files that will be regularly synced.
ProfileNameProfileName
同步處理 CSV 檔案時,依據的 SDS 同步處理設定檔名稱。Name of the SDS Sync Profile you are syncing the CSV Files against.
UserNameUserName
要搭配 SDS 使用的全域系統管理員帳戶 UserPrincipalName。UserPrincipalName of the Global Admin Account to be used with SDS.
LogPathLogPath
存放驗證記錄檔的目錄路徑。Path to the directory where you would like to store your validation log files.
RedirectOutputRedirectOutput
允許系統將 Validate 參數的輸出寫入指定目錄。如果您想要檢閱 Validate 參數的結果,必須指定該參數。Will allow the output of the validate parameter to be written out to the specified directory. This is required if you want to review the results of the validate parameter.
驗證Validate
在每次同步作業開始前執行驗證工作。如果您同時加入 RedirectOutput 參數,系統會在 Logpath 目錄中建立檔案。Run the validation task prior to each sync. Creates a file in the Logpath directory if the RedirectOutput parameter is also included.
TaskUserNameTaskUserName
在系統上的本機系統管理員的使用者名稱。Username of the local administrator on the system.
TaskStartTimeTaskStartTime
排程工作的開始時間。Time of day the scheduled task will begin.
StoreCredentialsStoreCredentials
在認證管理員中建立項目,以便執行排程工作。除非與該帳戶相關的密碼到期,否則認證將持續生效。Creates an entry in Credential Manager to run the scheduled task. The credential remains valid and continues to work, unless the password associated with this account expires.

以下範例會建立自動同步排程工作,依據名為 SDSSync 的同步處理設定檔同步處理 C:\temp 資料夾中的 CSV 檔案,同時會在 C:\temp\logs 資料夾建立驗證記錄檔,以及將 C:\temp\SDS\Logs 目錄設定為所有記錄檔的產生位置。該命令還會在同步作業開始之前針對 CSV 執行驗證程序,並將驗證輸出儲存在同一個 c:\temp\logs 目錄中。The following example creates an automated sync scheduled task for CSV files located in the C:\temp folder, on a sync profile called SDSSync, creates validation log files in the C:\temp\logs folder, and sets the C:\temp\SDS\Logs directory as the location for all log files generated. This command also runs the validation process for the CSVs before the sync begins and saves the validation output in the same c:\temp\logs directory.

Add-CsvFileSyncTask -CSVFolderPath "C:\\temp" -ProfileName "SDSSync" -LogPath "C:\\temp\\logs" -UserName admin@contoso.com -Validate -RedirectOutput

使用 School Data Sync 工具組來轉換 OneRoster CSV 檔案Use the School Data Sync Toolkit to convert OneRoster CSV files

您可以使用 Toolkit 轉換 OneRoster CSV 檔案並同步處理這些學校資料同步作業。若要這樣做,開啟 [以系統管理員身分的 PowerShell 並使用 Convert OneRosterToMicrosoftSDS 指令程式由下列的語法和範例中所述。轉換作業完成後,您可以再同步處理到 SDS,指示板 standard CSV 同步處理這些 CSV 檔。You can use the Toolkit to convert OneRoster CSV Files and sync them with School Data Sync. To do this, open PowerShell as an Administrator and use the Convert-OneRosterToMicrosoftSDS cmdlet as described by the following syntax and example. After the conversion is complete, you can then sync those CSV files through SDS, following our standard CSV sync guidance.

Convert OneRosterToMicrosoftSDS 語法Convert-OneRosterToMicrosoftSDS syntax

使用 Convert OneRosterToMicrosoftSDS 指令程式上傳並同步處理指定的同步處理設定檔的 CSV 檔案。Use the Convert-OneRosterToMicrosoftSDS cmdlet to upload and sync CSV files for a given sync profile.

Convert-OneRosterToMicrosoftSDS -OneRosterFolderPath <String> -SDSFolderPath <String> -LogPath <String>
參數Parameter 描述Description
OneRosterFolderPathOneRosterFolderPath
包含 CSV 檔案的資料夾路徑,這些 CSV 檔案是從 OneRoster 所匯出。Path to the folder containing the CSV files exported from OneRoster.
SDSFolderPathSDSFolderPath
資料夾的路徑,系統會在這裡建立轉換後的 CSV 檔案。Path to the folder where the converted CSV files will be created.
LogPathLogPath
資料夾的路徑,也就是您要存放這些動作記錄的位置。Path to the folder where you want logging stored on these actions.

以下範例會轉換一組位於 C:\temp\OneRoster 資料夾中的 OneRoster CSV 檔案、在本機電腦的 C:\temp\SDS 目錄建立一組新的 CSV 檔案,以及將 C:\temp\SDS\Logs 目錄設定為所有記錄檔的產生位置。The following example converts a set of OneRoster CSV files located in the C:\temp\OneRoster folder, creates a new set of CSV files located in the C:\temp\SDS directory of the local computer, and sets the C:\temp\SDS\Logs directory as the location for all log files generated.

Convert-OneRosterToMicrosoftSDS -OneRosterFolderPath "C:\\temp\\OneRoster" -SDSFolderPath "C:\\temp\\SDS" -LogPath "C:\\temp\\SDS\\logs"

使用 School Data Sync 工具組來驗證 CSV 檔案資料 (後續同步)Use the School Data Sync Toolkit to validate CSV file data (Post-sync)

若要在上傳及同步處理一組 CSV 檔案之後使用工具組來驗證 CSV 檔案,請以系統管理員身分開啟 PowerShell,再依照以下語法和範例的描述使用 Compare-DirectoryToCSVFiles Cmdlet。To use the toolkit to validate CSV files after you upload and sync a set of CSV files, open PowerShell as an Administrator and use the Compare-DirectoryToCSVFiles cmdlet as described by the following syntax and examples.

Compare-DirectoryToCSVFiles 語法Compare-DirectoryToCSVFiles syntax

使用 Compare-DirectoryToCSVFiles 來驗證指定同步處理設定檔的 CSV 檔案。Use the Compare-DirectoryToCSVFiles cmdlet to validate CSV files for a given sync profile.


Compare-DirectoryToCSVFiles -CsvFolderPath <String> -ProfileName <String> -UserName <String>
參數Parameter 描述Description
CsvFolderPathCsvFolderPath
包含 CSV 檔案的資料夾路徑。Path to the folder containing the CSV files.
ProfileNameProfileName
設定檔的名稱,該設定檔為您在 School Data Sync 中針對要驗證的 CSV 所建立。Name of the profile you've created in School Data Sync for the CSVs you want to validate.
UserNameUserName
系統管理員帳戶的使用者名稱,該帳戶擁有 Office 365 租用戶的全域管理員權限。User name of the admin account with Global admin rights for the Office 365 tenant.

以下範例會使用 admin@contoso.com 全域管理員帳戶,根據名為 School 1 的設定檔,針對位在本機電腦 c:\temp 目錄中的 CSV 檔案執行用戶端驗證。The following example performs client side validation of CSV files located in the c:\temp directory of the local computer, for a profile called "School 1", using the global admin account of "admin@contoso.com".


Compare-DirectoryToCsvFiles -CsvFolderPath "c:\\temp" -ProfileName "School 1" -UserName "admin@contoso.com"

疑難排解: 無法執行自動同步處理內學校資料同步處理工具組Troubleshooting: Unable to run the Automated Sync within the School Data Sync Toolkit

步驟 1。刪除工作排程器中的工作。Step 1. Delete the task in task scheduler.

步驟 2。開啟 [以系統管理員身分的 Powershell 並執行:Step 2. Open Powershell as an administrator and run:


Add-CsvFileSyncTask -CSVFolderPath “path to csv file location” -ProfileName “name of sync profile in SDS” -LogPath “path to store logs” -UserName “global admin account” -RedirectOutput  

步驟 3。如果發生錯誤,請下載最新的 AZCopy 從此處。Step 3. If errors occur, please download the newest AZCopy from here.

步驟 4。嘗試再次執行上述命令。Step 4. Attempt to run the above command again.

步驟 5。命令執行之後,請移至 [工作排程器並開啟工作並確認記錄檔中。Step 5. After the command runs, go to the Task Scheduler and open the task and verify within the logs.

School Data Sync 的概觀Overview of School Data Sync

適用於 School Data Sync 的 CSV 檔案CSV files for School Data Sync

如何使用 CSV 檔案部署 School Data SyncHow to deploy School Data Sync by using CSV files

如何使用 PowerSchool Sync 部署 School Data SyncHow to deploy School Data Sync by using PowerSchool Sync

如何使用聰明格式的 CSV 檔案部署學校資料同步處理How to deploy School Data Sync by using CSV files in the Clever format

如何使用 OneRoster CSV 檔案部署 School Data SyncHow to deploy School Data Sync by using OneRoster CSV files

School Data Sync 常見錯誤和疑難排解School Data Sync errors and troubleshooting