0

Exchange 2013 のスケジュールされたタスクで毎晩実行するスクリプトをセットアップしようとしています。exchange コマンドレットを実行する .ps1 を作成し、次に実行するスクリプトを実行します。PowerShell が Exchange にアクセスした後にスクリプトが実行されないという問題が発生しています。

スクリプトは次のとおりです。

powershell.exe -NonInteractive -noexit -command ".'E:\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell"

Set-CalendarProcessing -Identity "Room" -BookingWindowInDays (New-timespan -Start (GET-Date) -End 12/1/16).days

スクリプトをコピーして PowerShell に貼り付けると機能しますが、.ps1 ファイルを右クリックして [PowerShell で実行] を選択すると、Exchange に接続されますが、残りは実行されません。

どんな助けでも大歓迎です。ありがとうございました。

4

1 に答える 1