[Enter feedback here]
I'm receiving this warning:
WARNING: Using New-PSSession with Basic Authentication is going to be deprecated soon, checkout https://aka.ms/exops-docs for using Exchange Online V2 Module which uses Modern Authentication.
When reading the mentioned documentation, I see that the new module is still in preview and is not functional on Linux yet. To me that seems like a utterly premature deprecation warning, unless Microsoft is actually intending to leave users out in the cold after allowing those same users first to adopt new technologies, which would be even worse!
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
To make matters worse, there doesn't seem to be any way to hide this horrid WARNING, which is breaking my script.
$WarningPreference has no effect
[...] 3>$null has no effect
[...] | Out-Null results in the $PSSession being empty and still shows the damn warning
I'm highly annoyed with this change, when there is no way to acknowledge it or there is no working alternative yet
@officedocsbot assign @yogkumgit
I'm facing the same issue. See open GitHub issue and SO question, below:
https://github.com/PowerShell/PowerShell/issues/12563
https://stackoverflow.com/questions/61549872/powershell-redirection-does-not-always-work
Hi
This message is going to be disabled soon. For now, please use an extra parameter in ConnectionUri to hide the message -
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?HideBannermessage=true -Credential $UserCredential -Authentication Basic -AllowRedirection
@navgupta1208 Thanks for the info.
Can you elaborate any more as to why this message is not controlled by redirection?
I am trying to understand the root cause for redirection not to work in this instance as it still impacts a library I am developing.
@daverickdunn - We will investigate on why it is not controlled by redirection.
What does this Warning Message break for you ? Can you share more on the exact impact ?
@navgupta1208 I'd really appreciate that, thank you.
I've built up a good deal of experience with wrapping PowerShell scripts for over a year now in both C# and NodeJS (It's a long story, but C# was not suitable for my use case, so I moved NodeJS instead).
I've found that NodeJS doesn't have any good libraries for wrapping PowerShell, there is one popular one but it has serious stability issues and pipes all 6 message streams out via std_out. This is messy to parse on the NodeJS side.
I have developed a wrapper script that cleanly serialises PowerShell message streams for transmission over std_out. It's working very well, and acts as a good interface between PowerShell and any other language that can parse JSON. I have a working package on NPM, built in TypeScript, and would like to release versions for other languages too (the power is in the wrapper script, not the calling language).
You can see the wrapper script on GitHub
Also, please see this StackOverflow question for full details on what I've tried, etc.
I can bypass unexpected output such as this warning message, but I do not want to do that if possible - the warning is there for a reason.
It's very concerning that PowerShell doesn't appear honour such a fundamental aspect of the language.
Again, thanks for any info you can provide.
For me, it breaks a PHP script that is calling Powershell to interact with my mailboxes (allows my users to easily create email-aliases through a browser plugin).
For now I have bypassed the warning-message by splitting the std-out string on newlines and matching/checking all elements in the resulting array for valid JSON.
navgupta1208, For me this warning breaks some of my monitoring. As a MSP I have various scripts which retrieve data for all of our O365 tenants. I run these scripts from our RMM tool and create tickets based on the results. With this banner now showing up, scripts that would have otherwise returned no data and been considered in a "success" state, now return that warning banner which results in the monitoring being in a "failed" state. Also, the option to use ?HideBannermessage=true is great however I cant seem to get that to work in combination with ?DelegatedOrg=contoso.com (https://outlook.office365.com/powershell-liveid?DelegatedOrg=contoso.com). Please advise.
Hi @BeaconMRat you might want to follow this issue as well: https://github.com/PowerShell/PowerShell/issues/12563
What I would like to do is start using Exchange Online PS v2 Connect-ExchangeOnline with the option -DelegatedOrganization in my scripts however when I use this I receive the following message.
"New-ExoPSSession : AADSTS50079: Due to a configuration change made by your administrator, or because you moved to a new location, you must enroll in multi-factor authentication to access '00000002-0000-0ff1-ce00-000000000000'."
I do not currently have MFA on the account I am using. If I must enable MFA on my account that is fine however what would be the process of connecting in a script if I have MFA enabled. Below is the code I am currently using which is resulting in the error above. Any help would be greatly appreciated.
$user = "[email protected]"
$pass = "P@ssw0rd"
$password = $pass | ConvertTo-SecureString -asPlainText -Force
$creds = New-Object -typename System.Management.Automation.PSCredential -Argumentlist $user, $password
Connect-ExchangeOnline -Credential $creds -ErrorAction Stop -ShowBanner:$false -DelegatedOrganization "contoso.com"
I've just got the deprecation notice and it brought me to this thread.
I'm using PartnerCenter module to acquire and refresh OAuth2 tokens to connect EXO PowerShell with MFA enabled account: https://gitlab.com/yaegashi/exops1demo
It make a persistently automated EXO PowerShell remoting in CI on Linux possible. I hope that the new EXO v2 cmdlets could also be capable of accepting user-supplied access tokens like this.
@BeaconMRat You could probably get away with setting an AppPassword for the useraccount and use that.
Hello everyone,
I think @navgupta1208 and yourself answered your questions/concerns and there is nothing to update in the article at the moment.
Another suggestion that I want to make is that you use the email to provide the Exchange module V2 feedback to the product group, as indicated in the following article:
https://docs.microsoft.com/powershell/exchange/exchange-online/exchange-online-powershell-v2/exchange-online-powershell-v2
From it:
"The Exchange Online PowerShell V2 module is currently in Preview. If you have any feedback, concerns, or are facing any issues with the EXO V2 module, contact us at exocmdletpreview[at]service[dot]microsoft[dot]com (email address intentionally obscured to help prevent spam)."
Thanks!
Email would not have made it visible to other people. But yes, I'm glad @navgupta1208 is looking into this.
Anyone have an idea which git-repo I should subscribe to to keep up to date on the actual releases of EXO PS V2?
Hi @djpbessems,
This is the repo you should follow:
https://github.com/MicrosoftDocs/office-docs-powershell
And it´s also a good idea to follow this blog:
https://techcommunity.microsoft.com/t5/exchange-team-blog/bg-p/Exchange
@dariomws Thank you very much for the contribution and sharing this explanation. @djpbessems
Hope this comment is helpful for you. If you see a documentation update is required, please feel free to open an issue for the same. We proceed here to close it. Thanks for taking out some time to open the issue. Appreciate and encourage you to do the same in future also.
Most helpful comment
To make matters worse, there doesn't seem to be any way to hide this horrid WARNING, which is breaking my script.
$WarningPreferencehas no effect[...] 3>$nullhas no effect[...] | Out-Nullresults in the $PSSession being empty and still shows the damn warningI'm highly annoyed with this change, when there is no way to acknowledge it or there is no working alternative yet