Scheduled Task only fails to print when user not logged in
setting stage:
i trying print pdf reports networked printer scheduled task @ 6am daily. i have powershell 2.0 script on windows 2008 r2 checks trigger file path folder pdf reports in , iterates on files looking 3 specific files print , prints them default printer installed network printer. this task set run "whether user logged in or not" , set "to run highest privileges". it set run under service account admin access user installed printer. the code used print default printer is:
start-process -filepath "$archivepath\$($pdf.name)" -verb print
the problem:
issue having process prints if user logged server. everything else works, logging opening of pdf in adobe reader, everything. it not send report printer. if log in @ 5:55am , watch process , print spooler can see work, if log in @ 6:01am can see processes running in task manager , track log reports never sent printer.
have tried:
have tried run bat script self elevated powershell in hopes permission issue using:
not sure else check or change. i not getting errors in event viewer or anywhere else. the print doesn't work , right option @ 5:45 , log in.set powershellscriptpath=d:\scripts\print_hfm_reports.ps1start /wait powershell -noprofile -executionpolicy bypass -command "& {start-process powershell -argumentlist '-noprofile -executionpolicy bypass -file "%powershellscriptpath%"' -verb runas}";
that correct. shell verbs require full user interactive session. need use direct adobe automation print pdf. post in adobe forum learn how use reader print script.
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment