Announcement

Collapse
No announcement yet.

How do I create a batch file in exchange 07

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I create a batch file in exchange 07

    For example a simple PS command like "get-mailbox" . How do I put that into a script so that I just need to double click on it & it will open on the screen & stay there showing me the output?

    If I double click on a .ps1 file it just opens notepad & displays the contents of the script. So i gather I need to create a script in dos that calls on the .ps1 file & then?

  • #2
    Re: How do I create a batch file in exchange 07

    You need something like this as the shortcut to the script:

    %windir%\system32\WindowsPowerShell\v1.0\powershel l.exe D:\scripts\script.ps1 -noprofile -Noninteractive

    You may have to adjust the last two switches depending on what the script does.

    and then the first line of the PS script needs to be this:

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

    Simon.
    --
    Simon Butler
    Exchange MVP

    Blog: http://blog.sembee.co.uk/
    More Exchange Content: http://exchange.sembee.info/
    Exchange Resources List: http://exbpa.com/
    In the UK? Hire me: http://www.sembee.co.uk/

    Sembee is a registered trademark, used here with permission.

    Comment


    • #3
      Re: How do I create a batch file in exchange 07

      Great thanks, I'll give that a try.

      Comment

      Working...
      X