0 votes

We still use MsolService (MSOnline) Cmdlets because newer modules don't have some of the features. With the depreciation of GetOffice365Credential how should we should we move forward? Go back to SecureString and PSCredential values again or use the Azure token?

Connect-MsolService -AdGraphAccessToken $Context.CloudServices.GetAzureAuthAccessToken()

by (1.6k points)
edited by
0

Hello,

Unfortunately, the approach used in your example will not work because the token returned by the GetAzureAuthAccessToken() method can be used only for connection to Microsoft 365 via MS Graph. We are in contact with Microsoft support on how Connect-MsolService can be used to connect to Microsoft 365 using tokens. Once there is a solution, we will get back to you right away.

Could you, please, clarify what functionality of MsolService is required by your workflow? It might be that Connect-AzureAD or other cmdlets that are intended to establish connection to Microsoft 365 can be used. Live examples, scripts currently used and any additional details about the desired behavior would be much appreciated.

0

Reset-MsolStrongAuthenticationMethodByUpn

There are also a number of low-level functions that the module provides that are not available in newer modules, see: https://docs.microsoft.com/en-us/powershell/module/msonline/?view=azureadps-1.0

0

Hello,

Thank you for the clarification. Strong authentication reset can be performed only via MSOnline or MS Graph. If MS Graph does not meet your needs, you can specify credentials for the Connect-MsolService cmdlet via the This account option in the Run as section of the Run a program or PowerShell script action parameters. image.png

To retrieve the credentials and connect to MSOnline, you can use a code like the following:

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

Connect-MsolService -Credential $credential

Once we have an answer from Microsoft support on how to connect to MSOnline using the Connect-MsolService cmdlet with authentication tokens, we will publish the solution here right away.

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Is there a command line that would install the admin console and the powershell module silently? we would like to utilize our ConfigMgr system to deploy this app to ... for them to know what modules to install or elevating their user accounts. Thanks!

asked Mar 1, 2017 by ggallaway (1.4k points)
0 votes
1 answer

Dear Support, can you please advise how to properly troubleshoot Connect-MSOlService? I have x64 Adaxes installation I have this function properly working in Powershell ISE and ... Directory Module for Wind... Powershell version 5.1 Thanks for any advise!

asked Jul 5, 2019 by Dmytro.Rudyi (4.1k points)
0 votes
1 answer

Any idea if MSOnline 1.1.166.0 is supported? If not any idea when it will be supported?

asked May 3, 2017 by Brajesh (2.5k points)
0 votes
1 answer

Hello, i have a custom command which sets the oof-message for the selected user. in this custom command i have a parameter "param-vertretung" (ad-object picker). Now i want to ... and email of the stand-in in the oof-message. Can you help me with that? Thanks

asked Nov 13, 2020 by lohnag (1.1k points)
0 votes
1 answer

Hello, we create reports for every group in every OU. But what i need is, that the Description is also shown from the group, a user is in. For example: This is how my ... . but what i need is the description of the group. Is this possible? Thank you in advance

asked Oct 5, 2020 by m_st (1.5k points)
2,412 questions
2,165 answers
5,832 comments
224,329 users