Executing powershell scripts via Task Scheduler


hi,

i have powershell script wrote when executed shell works fine when executed task scheduler not work.

in script, email sent out based on results of execution.  when run shell, email goes out, when scheduled, no email , there no indication of errors having occurred anywhere in system.

has run similar issue?

i did change powershell execution policy unrestricted (both in x86 , x64 consoles).  i running windows 2008 r2.

thanks - greg.

found answer - enclosing entire arguments in double quotes , parameters in single quotes ensured correct values being passed parameters.

http://www.techtalkz.com/microsoft-windows-powershell/146575-commandline-argument-parsing-spaces.html



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...