Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Cant run simple Exchange 2013 Powershell Script at Task Scheduler

$
0
0

Hi,

i created a simple script named test.ps1, with the following content:

Search-Mailbox -Identity "Mailboxname1" -SearchQuery "Subject:'Something'" -DeleteContent -Force
Search-Mailbox -Identity "Mailboxname2" -SearchQuery "Subject:'Something'" -DeleteContent -Force
Search-Mailbox -Identity "Mailboxname3" -SearchQuery "Subject:'Something'" -DeleteContent -Force

Taskscheduler/ Program/Script

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Taskscheduler / Arguments

-NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; C:\Program Files\Microsoft\Exchange Server\V15\Scripts\test.ps1

But it will not work, sadly i dont realy know where to look at for an error message. if i run the simple script directly from the EMS it will work perfectly....



Viewing all articles
Browse latest Browse all 15028

Trending Articles