Benutzer mit den meisten Antworten
PowerShell Script über den Task Scheduler starten

Frage
Antworten
-
Hallo Werner211
also ich würde das wie unter http://technet.microsoft.com/en-us/library/bb123798.aspx beschrieben machen:
If you want to run a script on a scheduled basis using the Windows Task Scheduler service, you can call the Shell and include the script that you want to run as a parameter. If you want to use Exchange cmdlets with your script, you must direct Windows PowerShell to connect to a server running Exchange and load the Exchange cmdlets you have access to. The shortcut you use to open the Shell does this automatically. To do this when you want to run a script that contains Exchange cmdlets, you must direct Windows PowerShell to run the scripts that make this connection. This syntax is required to open Windows PowerShell, connect to an Exchange server, and run your script from the Cmd.exe command.
PowerShell.exe -command ". 'D:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; <path to your script>"
Ein etwas andere Beispiel solltest Du auch schon auf Deinem Exchange Server finden. Schau mal in den Scheduled Tasks, da müsste ein Task mit der Bezeichnung "Database One Copy Alert" erscheinen.
Viele Grüße
Timo
- Bearbeitet Timo Geuken Donnerstag, 24. Mai 2012 19:34
- Als Antwort markiert Alex Pitulice Dienstag, 29. Mai 2012 08:36
Alle Antworten
-
Hallo Werner211
also ich würde das wie unter http://technet.microsoft.com/en-us/library/bb123798.aspx beschrieben machen:
If you want to run a script on a scheduled basis using the Windows Task Scheduler service, you can call the Shell and include the script that you want to run as a parameter. If you want to use Exchange cmdlets with your script, you must direct Windows PowerShell to connect to a server running Exchange and load the Exchange cmdlets you have access to. The shortcut you use to open the Shell does this automatically. To do this when you want to run a script that contains Exchange cmdlets, you must direct Windows PowerShell to run the scripts that make this connection. This syntax is required to open Windows PowerShell, connect to an Exchange server, and run your script from the Cmd.exe command.
PowerShell.exe -command ". 'D:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; <path to your script>"
Ein etwas andere Beispiel solltest Du auch schon auf Deinem Exchange Server finden. Schau mal in den Scheduled Tasks, da müsste ein Task mit der Bezeichnung "Database One Copy Alert" erscheinen.
Viele Grüße
Timo
- Bearbeitet Timo Geuken Donnerstag, 24. Mai 2012 19:34
- Als Antwort markiert Alex Pitulice Dienstag, 29. Mai 2012 08:36
-
Na ja, ich habe einfach mal irgendwas geschrieben. Vielleicht hat es ja gepasst :-)
Spaß beiseite... Werner211 hatte Probleme ein PowerShell Script über den Task Scheduler zu starten. Warum er die Frage dann aber gelöscht hat, weiß wahrscheinlich nur er.
Viele Grüße
Timo
-
Hallo,
danke Dir auf jeden Fall Timo für die Hilfe. :)
Gruss,
Alex
Alex Pitulice, MICROSOFT
Bitte haben Sie Verständnis dafür, dass im Rahmen dieses Forums, welches auf dem Community-Prinzip „IT-Pros helfen IT-Pros“ beruht, kein technischer Support geleistet werden kann oder sonst welche garantierten Maßnahmen seitens Microsoft zugesichert werden können.