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.