Suppress Credential popup while exchage cmdlet execution.

Copper Contributor

I use

$cred = get-credential  (enters credentials)

connect-exchangeonline -Credential $cred

after this powershell asks me login in pop up when the account is improper or has MFA. is there a way to block the credential popup and just show the error message. and this also occurs if we execute a cmdlet for an active session in which the user's account's credential has been changed in between. pspopup.png

 

Also the error message is not in the error stream. actual error is displayed like info.

pspopup2.png

 

2 Replies
That happens because the module tries to re-establish the connection. You'll have to edit the module binaries to get rid of it.
Hi, is there any ways or resources available to edit the binaries ?