Custom Exchange Management Shell script

Welcome Forums General PowerShell Q&A Custom Exchange Management Shell script

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 month, 3 weeks ago.

  • Author
    Posts
  • #168961

    Participant
    Topics: 3
    Replies: 2
    Points: -6
    Rank: Member

    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?

  • #168967

    Participant
    Topics: 8
    Replies: 18
    Points: 108
    Rank: Participant

    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.

  • #168973

    Participant
    Topics: 3
    Replies: 2
    Points: -6
    Rank: Member

    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.

     

You must be logged in to reply to this topic.