Custom Exchange Management Shell script

Hi Everyone,

I’m kind of new to this site, so this is my first question. If i’m doing something wrong, please let me know.

About the question I got, recently we upgraded our management servers tot server 2016. Now I came to the conclusion that the Exchange Management Shell (Tools) from Exchange 2013 is not supported in Server 2016.

Now I created a own script with the Enter-PsSession, but when I run this with Powershell (Right-Click > Run With or Open With) it starts the import, but closes after the script is done. What I want is when the import is done, I can enter commands.

It works when I manually open it in Powershell ISE of when I first open Powershell and then open the script, but I want it to work when I press Right-Click etc.

Does someone has an solution?

If you want to keep the Enter-PSSession open so you can use it, it needs to be running in an interactive console window.

This means either opening a new console or potentially using Start-Process to create a console that stays open when right/double-clicking to open.
Start-Process’s help examples will show you how IIRC.

Thank you for your reply. I don´t know if I fully understand it. I created a new PS file, put the Start-Process -path “…\ExchangeManagementScript.ps1” into it and when I run it, it start the script, but still closes after completing.