Powershell connect-microsoftteams mfa via userform generates unhandled exception

%3CLINGO-SUB%20id%3D%22lingo-sub-2848157%22%20slang%3D%22en-US%22%3EPowershell%20connect-microsoftteams%20mfa%20via%20userform%20generates%20unhandled%20exception%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2848157%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I'm%20trying%20to%20create%20a%20gui%20frontend%20to%20a%20number%20of%20scripts%20to%20make%20them%20easier%20to%20access%20and%20use%20for%20colleagues%20.%20Some%20of%20the%20scripts%20require%20connections%20to%20O365%20admins%20like%20connect-microsoftteams.%20At%20first%20the%20MFAs%20for%20the%20connects%20wouldn't%20even%20appear.%20Uncle%20google%20advised%20to%20use%20Powershell%207%20when%20connecting%20through%20userforms.%20Which%20we%20installed%20and%20that%20did%20make%20the%20MFAs%20appear.%20However%2C%20when%20authenticating%20the%20MFA%2C%20I%20get%20a%20unhandled%20exception%20(an%20issue%20with%20the%20parameter%20'session')%20and%20MFA%20browser%20window%20says%20'Can't%20reach%20this%20page'.%20And%20the%20url%20of%20the%20MFA%20browser%20window%20is%20calling%20an%20odd%20localhost%3A.....%20url.%20clicking%20Continue%20on%20the%20unhandled%20exception%20does%20nothing%3C%2FP%3E%3CP%3E%3CSPAN%3EOutside%20of%20the%20gui%2C%20the%20connections%20work%20fine.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI've%20tried%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Etry-catch%20block%2C%20no%20change%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26amp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Enetsh%20winhttp%20reset%20proxy%2C%20no%20change%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22bdubbmw_0-1634251084335.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317541i5A224D06575315F0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22bdubbmw_0-1634251084335.png%22%20alt%3D%22bdubbmw_0-1634251084335.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%20how%20I%20can%20get%20passed%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2848157%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi, I'm trying to create a gui frontend to a number of scripts to make them easier to access and use for colleagues . Some of the scripts require connections to O365 admins like connect-microsoftteams. At first the MFAs for the connects wouldn't even appear. Uncle google advised to use Powershell 7 when connecting through userforms. Which we installed and that did make the MFAs appear. However, when authenticating the MFA, I get a unhandled exception (an issue with the parameter 'session') and MFA browser window says 'Can't reach this page'. And the url of the MFA browser window is calling an odd localhost:..... url. clicking Continue on the unhandled exception does nothing

Outside of the gui, the connections work fine.

I've tried:

try-catch block, no change

&

netsh winhttp reset proxy, no change

 

bdubbmw_0-1634251084335.png

 

Any ideas how I can get passed this?

1 Reply
I think I found the answer. Simply switch the default browser to MS Edge.