+1 vote

Hi all,

Just wondering how I would go about connecting to Teams using Adaxes? I need to perform the following modifications to users:

Set-CsUser -Identity <UPN> -EnterpriseVoiceEnabled $true -HostedVoiceMail $true Grant-CsOnlineVoiceRoutingPolicy -Identity <UPN> -PolicyName “(policyname)”

Grant-CsCallingLineIdentity -Identity <UPN> -PolicyName "(policyname)"

I don't know how to make Adaxes connect to MS Teams however - I have found this script to connect to exchange online, however this uses an in-built command to do so. I don't think Adaxes has similar commands for Teams yet though? https://www.adaxes.com/script-repository/connect-to-exchange-with-powershell-s506.htm

Does anyone here know how to make Adaxes connect to Teams using the Connect-Microsoftteams command and run the above?

by (110 points)

Very interested in this as well, as we're looking at doing as much management of Microsoft Phone System through Adaxes as possible.


Just released today, this looks like it might help this effort: Teams PowerShell Module 2.0

1 Answer

0 votes
by (212k points)


In Adaxes 2020.1 and older you can use the New-CsOnlineSession cmdlet with the credentials specified for your Microsoft 365 tenant registered in Adaxes.

In Adaxes 2021.1 there is currently no such possibility as the corresponding module does not support modern authentication. As a workaround, you can specify the credentials in the Run as section of the Run a program or PowerShell script action, access them in your script as shown below and then use to establish the connection.

# Get credentials.
$password = ConvertTo-SecureString -AsPlainText -Force -String $Context.RunAs.Password
$credentials = `
    New-Object System.Management.Automation.PsCredential($Context.RunAs.UserName, $password)

If you have issues writing the required script, please, specify the following:

  • What version of Adaxes are you currently using? For information on how to check it, have a look at the following help article: https://www.adaxes.com/help/CheckServiceVersion.
  • What exactly should the script do?
  • When should the script be executed?

Any additional details and live examples will be very helpful.

Related questions

0 votes
1 answer

I am trying to connect to teams via powershell in adaxes to run the following commands. Set-CsUser -Identity &lt;UPN&gt; -EnterpriseVoiceEnabled $true -HostedVoiceMail $true ... (policyname)" I am not able to run the following though, Connect-MicrosoftTeams

asked Apr 22, 2021 by TJ_Umredkar (130 points)
0 votes
1 answer

Is this possible? We have a potential use case where we want to "natively" query AD using LDAP, but want to be able to leverage custom attributes\data in Adaxes, ... we can query the LDS instance and access both native and custom attributes etc. Many Thanks

asked May 25, 2017 by firegoblin (1.6k points)
0 votes
1 answer

Hi, we are using Adaxes version 3.14.18920.0. We have Teams Poweshell module 2.3.1 installed on the computer where adaxes service runs. We have the ... } finally { # Close the connection and release resources Disconnect-MicrosoftTeams -Confirm:$False }

asked Jun 22, 2021 by TJ_Umredkar (130 points)
0 votes
1 answer

We have internal AD that syncs to o365 via Azure AD Connect. It is not a hybrid environment; there is no Exchange on site. I am trying to find the best way to use Adaxes to ... so I am not sure the best way to handle that. Thanks for any help you can provide.

asked Apr 15, 2020 by Jasonmh (540 points)
0 votes
1 answer

Is it possible to connect to the Microsoft 365 Security &amp; Compliance center through a PowerShell script? We are trying to configure users that belong to a ... department for a retention policy through the use of the Set-RetentionCompliancePolicy command.

asked Jan 3 by scoutcor (100 points)
2,629 questions
2,364 answers
962,097 users