Using Microsoft Online Modules that require authentication popup

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Sthompson
Posts: 1
Last visit: Mon May 08, 2023 4:33 am

Using Microsoft Online Modules that require authentication popup

Post by Sthompson »

Hi,

Hoping this will be really simple, I am trying to use Connect-MicrosoftTeams when my form loads. In PowerShell, this will open a Microsoft 365 login screen which allows you to login with your credentials to create the remote PowerShell session with the Microsoft Tenant.

When executing this, there is no popup for credentials which causes this to hang and not connect.

How can I get this popup to enter the credentials?

Thanks,
Steve.

Product, version and build:5.8.194
Operating system: Windows 10
PowerShell version(s): v5.1

*** Please add details and screenshots as needed below. ***

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Using Microsoft Online Modules that require authentication popup

Post by brittneyr »

[Topic moved by moderator]
Brittney
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Using Microsoft Online Modules that require authentication popup

Post by jvierra »

Simple answer. You can't.

Depending on the version of the Cmdlets you can try setting MTA which works with some Cmdlets but the best method is to post in the "Teams" developer web forum for methods used to persist credentials outside of the process. You can also connect before the form is created then call the form function.

Here is the fundamental method that works in most cases. I recommend actually building the example which is mostly copying it and testing. Be sure to have the latest "Teams" module installed.

https://www.reddit.com/r/PowerShell/com ... ms_in_gui/
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked