使用 PowerShell 管理商務用 Skype OnlineManage Skype for Business Online with PowerShell

本文適用於 Microsoft 365 企業版和 Office 365 企業版。This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.

商務用 Skype Online 系統管理員負責管理原則。Skype for Business Online administrators are responsible for managing policies. 雖然您可以在 Microsoft 365 系統管理中心中執行其中一些工作,但是使用 PowerShell 可以更輕鬆地完成其他工作。Although you can do some of these tasks in the Microsoft 365 admin center, others are easier to do in PowerShell.

開始之前Before you start

注意

商務用 Skype Online 連接器目前是最新 Teams PowerShell 模組的一部分。Skype for Business Online Connector is currently part of the latest Teams PowerShell module. 如果您使用的是最新的 Teams PowerShell 公開發行版本,則不需要安裝商務用 Skype Online 連接器。If you're using the latest Teams PowerShell public release, you don't need to install the Skype for Business Online Connector.

安裝Teams PowerShell 模組安裝Install the Teams PowerShell module.

使用系統管理員認證連線Connect using admin credentials

  1. 開啟 Windows PowerShell 命令提示視窗,然後執行下列命令:Open a Windows PowerShell command prompt window and run the following commands:

    Import-Module MicrosoftTeams
    $userCredential = Get-Credential
    $sfbSession = New-CsOnlineSession -Credential $userCredential
    Import-PSSession $sfbSession
    
  2. [Windows PowerShell 認證要求] 對話方塊中,輸入您的系統管理員帳戶名稱和密碼,然後選取 [確定]In the Windows PowerShell Credential Request dialog box, type your administrator account name and password, and then select OK.

使用具有多重要素驗證的系統管理員帳戶進行連線Connect using an admin account with multi-factor authentication

  1. 開啟 Windows PowerShell 命令提示視頻,然後執行下列命令:Open a Windows PowerShell command prompt window, and run the following commands:

    Import-Module MicrosoftTeams
    $sfbSession = New-CsOnlineSession
    Import-PSSession $sfbSession
    
  2. 當出現 New-CsOnlineSession 命令提示時,請輸入您的商務用 Skype Online 系統管理員帳戶名稱。When prompted by the New-CsOnlineSession command, enter your Skype for Business Online administrator account name.

  3. [登入您的帳戶] 對話方塊中,輸入商務用 Skype Online 系統管理員密碼,然後選取 [登入]In the Sign in to your account dialog box, type your Skype for Business Online administrator password and select Sign in.

  4. [登入您的帳戶] 對話方塊中依照指示,提供驗證資訊(例如驗證碼),然後選取 [驗證]In the Sign in to your account dialog box, follow the instructions to add authentication information, such as a verification code, and then select Verify.

如需詳細資訊,請參閱:For more information, see:

另請參閱See also

使用 PowerShell 管理 Microsoft 365Manage Microsoft 365 with PowerShell

開始使用適用於 Microsoft 365 的 PowerShellGet started with PowerShell for Microsoft 365

商務用 Skype PowerShell Cmdlet 參考(英文)Skype for Business PowerShell cmdlet references