Exchange Online V2 Invoke Powershell Cmdlets

Im trying to use the new preview of “Exchange Online V2” as its replacing the old “New-PsSession”

The piece of code im trying to run inside the Invoke Powershell activity is

Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true

Which stops in UiPath with this error below

“Powershell Invoke: The term ‘Connect-ExchangeOnline’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”

This code works fine in Windows Powershell.

Any help would be appreciated

1 Like

Hi Michael,

I’m also encountering the same issue, have you managed to find a resolution yet?



Apparently is a limitation of UiPath as it cant run the activity “Invoke Powershell” in admin mode.

If you can get it to run in admin when it kicks off then it works that way you can get it to set the correct execution policy to work.

Hi all

Did you ever find a solution to this please?
I’m facing the same issue :frowning: