The script establishes a connection to Microsoft Teams. The script requires the MicrosoftTeamsPowerShell module to be installed on the computer where Adaxes service runs.
PowerShell
# Get access tokens
$graphToken = $Context.CloudServices.GetAzureAuthAccessToken("https://graph.microsoft.com")
$teamsToken = $Context.CloudServices.GetAzureAuthAccessToken("48ac35b8-9aa8-4d74-927d-1f4a14a0b239")
# Connect to Microsoft Teams
try
{
Connect-MicrosoftTeams -AccessTokens @($graphToken, $teamsToken)
$team = Get-Team -DisplayName "My Team" # TODO: replace with the code you need to execute
}
finally
{
# Close the connection and release resources
Disconnect-MicrosoftTeams -Confirm:$False
}
-Assign the certificate to the Azure application whose credentials were used to register your Microsoft 365 tenant in Adaxes.
-Grant Azure application access to Microsoft Teams.
-Install the certificate on the computer where Adaxes service runs.
>-Assign the certificate to the Azure application whose credentials were used to register your Microsoft 365 tenant in Adaxes.
>-Grant Azure application access to Microsoft Teams.
>-Install the certificate on the computer where Adaxes service runs.
On the computer where Adaxes service is installed, right-click the certificate file and then click Install Certificate. Follow the instructions in the Certificate Import Wizard.
Version 2.3.2 works but non cs* commands possible.
Managing teams with Adaxes withouth interactive login seems impossible for now
> Connect-MicrosoftTeams version 2.5.0 not working anymore
Yes, that is correct and there is currently no related documentation from Microsoft.
>Version 2.3.2 works but non cs* commands possible.
Yes, the script works fine with the module version 2.3.2.
>Managing teams with Adaxes withouth interactive login seems impossible for now
That is not correct. You can specify user account credentials in the Run as section of the Run a program or PowerShell script action and then use them in your script. For details, see section Running the script as a specific user of the following SDK article: https://adaxes.com/sdk/ServerSideScripting/#running-the-script-as-a-specific-user.