Responsive form when importing Exchange Online session

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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 6 years and 5 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
Alex.ferrie
Posts: 7
Last visit: Mon Jun 18, 2018 1:01 am

Responsive form when importing Exchange Online session

Post by Alex.ferrie »

I have a PowerShell form to be used by our first line team to create user accounts and Exchange Online mailboxes. At present, the first action taken is to connect to Office 365 and import the Exchange Online commands, however this leaves the form in an unresponsive state until the remote session has finished importing the commands.

Is there a way to run this which will still import the Exchange Online cmdlets and prevent the form being unresponsive as it loads?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Responsive form when importing Exchange Online session

Post by jvierra »

That is the normal behavior of PowerShell when it is importing. It cannot be changed
User avatar
Alex.ferrie
Posts: 7
Last visit: Mon Jun 18, 2018 1:01 am

Re: Responsive form when importing Exchange Online session

Post by Alex.ferrie »

thanks for the response Jvierra, I take it then there's no way to import the session through a job to avoid the delay?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Responsive form when importing Exchange Online session

Post by jvierra »

The bigger question is why is there a delay. I can import the session in about 2 to 3 seconds. Why are you seeing such a big delay?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Responsive form when importing Exchange Online session

Post by jvierra »

You can also copy and paste to a ListBox. The plus is that the ListBox can capture and parse the pasted text before displaying it. Pasting to a TextBox cannot do that.
This topic is 6 years and 5 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