在 Windows PowerShell 中變更 Planner 的先決條件

此程序會逐步引導您下載在 PowerShell 中執行 Planner 系統管理命令所需的檔案。

如果您是 Windows PowerShell 的新使用者,請參閱開始使用 Windows PowerShell

下載 Planner 租使用者 管理員 PowerShell 命令

注意事項

您必須是全域系統管理員,才能執行 Planner 租用戶系統管理員 PowerShell 命令。

注意事項

下載此套件即表示您同意隨附的授權與條款。

下載 Planner 租使用者 管理員 PowerShell 檔案。 將檔解壓縮到您可從 PowerShell 存取的位置。

解除封鎖您的檔案

您必須「解除封鎖」您在 Planner 租使用者 管理員 PowerShell 套件中下載的兩個檔案,才能在 PowerShell 中使用它們。 這是因為根據預設,不允許執行從因特網下載的腳本。 您必須解除封鎖的檔案為:

  • plannertenantadmin.psm1
  • microsoft.identity.client.dll

執行下列動作來解除封鎖這些檔案:

  1. 在 [檔案總管] 中,移至您要解壓縮檔案的位置。

  2. 以滑鼠右鍵按兩下上述其中一個解壓縮的檔案,然後選取 [屬性]。

  3. 在 [一般] 索引標籤上,選取 [解除封鎖]

    unblock-files。

  4. 選取 [確定]

  5. 為其他兩個檔案重複這些步驟。

載入 Planner 租用戶系統管理員 PowerShell 模組

解除封鎖您的檔案之後,請執行下列操作以載入 Planner 租用戶系統管理員 PowerShell 模組:

  1. 啟動 Windows PowerShell。 在 PowerShell 中,輸入下列命令以啟用從網際網路下載的指令碼 (僅適用此工作階段)。 它可能會提示您輸入 「Y」 來確認。

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
    
  2. 輸入下列命令來執行 PlannerTenantAdmin PowerShell 指令碼。 這會匯入具有所有可用 Cmdlet 的模組。

    Import-module "<location of the plannertenantadmin.psm1 file you unzipped>"
    

    例如,如果您的檔案儲存在 C:\AdminScript 中,您會輸入:

    Import-module "C:\AdminScript\PlannerTenantAdmin.psm1"
    

現在您已經可以使用 PowerShell 在組織層級變更 Planner。