Test the PowerShell Proxy Connection to the Tenant#

Test the connection from PowerShell to Microsoft Teams#

This procedure tests the connection to Microsoft Teams from a non-privileged PowerShell session.

  1. From a PowerShell session, configure a test session for an outbound Internet proxy (if your PowerShell Proxy server is behind an outbound Internet proxy that requires authentication):

    $w = New-Object System.Net.WebClient
    
    $w.Proxy.Credentials = (Get-Credential) (when prompted, enter your
    outbound proxy credentials)
    

    Note

    The credentials you enter above persist only for the duration of this PowerShell session, and are deleted when you exit the PowerShell session.

    See the caveat regarding proxy authentication, at: PowerShell Proxy Deployment Topologies

  2. Verify the version you’re using, (e.g. 6.1.0):

    Get-Module -ListAvailable -Name MicrosoftTeams
    
  3. Issue the following command to test the connection to Microsoft Teams and to perform a test query, and when prompted, you’ll need to enter your MS Teams service account credentials:

    Connect-MicrosoftTeams -Credential (Get-Credential)
    Get-CsOnlineUser -ResultSize 1 | Select DisplayName
    

    Note

    Perform step 1 first if your PowerShell Proxy is behind an outbound Internet proxy that requires authentication.

  4. Verify that you have successfully connected to the tenant and retrieved one random user.

Related Topics

(Optional - Exchange Online only) Test the connection from PowerShell to Microsoft Exchange#

  1. Use the following command to test the connection:

    Connect-ExchangeOnline -CertificateThumbPrint <certificate_thumbprint> -AppID <client_id> -Organization $online_admin_domain
    

    Note

    You will use your certificate_thumbprint, client_id and online_admin_domain, as in the following example:

    Connect-ExchangeOnline -CertificateThumbPrint A2DEF024C59B4969A30A8892F832F418DF09F6 -AppID 5ff3dc33-c8db-48ba-b86e-642d84d42ae0 -Organization VossSolutionsO365.onmicrosoft.com
    
  2. Use the following command, then confirm that you can see a user mailbox:

    Get-EXOMailbox -ResultSize 1
    

Related Topics