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.
Locked
User avatar
Alex.ferrie
Posts: 7
Joined: Fri Jun 02, 2017 7:46 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: 14480
Joined: Tue May 22, 2007 9:57 am
Contact:

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
Joined: Fri Jun 02, 2017 7:46 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: 14480
Joined: Tue May 22, 2007 9:57 am
Contact:

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: 14480
Joined: Tue May 22, 2007 9:57 am
Contact:

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.

Locked