Forum Discussion

JFM_12's avatar
JFM_12
Iron Contributor
Jul 30, 2024

List of Teams with uses Connectors

Hello Is there a way (Powershell, Power BI) to get a list of the Teams who use connectors and which ones (Name) they use? We have 180k teams but want only the teams that use the connectors and have...
  • Sayali-MSFT's avatar
    Sayali-MSFT
    Aug 06, 2024

    JFM_12 - The error message you're seeing, (403) Forbidden, indicates that the request you're making using Invoke-RestMethod in PowerShell is being blocked due to permission issues. 

    1. Verify API Permissions
    Make sure that the API endpoint you're trying to access is properly authorized and that the token or credentials used in the request have the correct permissions.

    • Check API Documentation: Ensure you have the correct permissions for the API you're calling. For Microsoft Teams APIs, this often means ensuring that your app has the required permissions granted in Azure AD.

    • Check Azure AD Permissions: If you're using OAuth tokens, ensure that your Azure AD application has the necessary permissions (e.g., Group.Read.All, User.Read.All, etc.) and that these permissions have been granted and consented to by an administrator.

    2. Validate Authentication

    Ensure your authentication token or credentials are correct and valid:

    • Generate a New Token: If you're using OAuth tokens, generate a new one and ensure it's being passed correctly in the request headers.

    • Check Token Expiry: Tokens have a limited lifespan. Verify that the token you're using has not expired.

      The (403) Forbidden error typically means that authentication or authorization is failing. By verifying permissions, ensuring correct authentication, and inspecting request details, you can usually resolve such issues.

Resources