SOLVED

Is it possible to launch a browser with task scheduler as system account?

%3CLINGO-SUB%20id%3D%22lingo-sub-3495457%22%20slang%3D%22en-US%22%3EIs%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3495457%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%20I%20hope%20you%20can%20help%3A%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20it%20possible%20to%20launch%20a%20browser%2C%3CBR%20%2F%3Eto%20open%20a%20web%20page%20that%20works%20in%20get%20mode%3CBR%20%2F%3Eusing%20powershell%20on%20task%20scheduler%2C%3CBR%20%2F%3Erunning%20as%20system%20account%20to%20avoid%20screen%20updating%2C%3CBR%20%2F%3Eevery%20time%20any%20user%20is%20logging%20in%2C%3CBR%20%2F%3Eand%20then%2C%20after%20the%20url%20responds%2C%3CBR%20%2F%3Eclose%20the%20browser%20gracefully%20(other%20than%20killing%20it)%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3495457%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3497899%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3497899%22%20slang%3D%22en-US%22%3E%22that%20works%20in%20get%20mode%20using%20powershell%20on%20task%20scheduler%22%20You%20have%20to%20give%20some%20more%20detail%2C%20do%20you%20wnat%20to%20download%2Finvoke%20something%20when%20a%20user%20logs%20in%3F%20You%20can%20start%20things%20at%20user%20login%2C%20but%20not%20as%20system%20login...%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3500754%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3500754%22%20slang%3D%22en-US%22%3Eok%2C%20I%20know%20what%20do%20I%20need%2C%20but%20how%20to%20do%20it...%20I'll%20try%20to%20clarify%20the%20scenario%3A%3CBR%20%2F%3E1)%20use%20task%20scheduler%20whenever%20a%20user%20logs%20in%2C%20to%20run%20powershell%20minimized%20or%20hidden%3CBR%20%2F%3E2)%20powershell%20must%20get%20some%20data%3CBR%20%2F%3E3)%20powershell%20must%20launch%20a%20browser%20minimized%20or%20hidden%3CBR%20%2F%3E4)%20browser%20must%20point%20to%20an%20url%20that%20runs%20in%20get%20mode%20(https%3A%2F%2F...%3Fdata1%26amp%3Bdata2...)%3CBR%20%2F%3E5)%20browser%20must%20be%20terminated%20gracefully%20(not%20being%20killed%20or%20abandoned)%3CBR%20%2F%3E6)%20use%20system%20account%20to%20avoid%20password%20change%20issues%20if%20possible%3CBR%20%2F%3E%3CBR%20%2F%3EActually%2C%20this%20is%20what%20I%20got%3A%3CBR%20%2F%3E1)%20done%2C%20except%20by%20running%20minimized%20or%20hidden%3CBR%20%2F%3E2)%20done%3CBR%20%2F%3E3)%20browser%20launch%20done%2C%20but%20not%20minimized%20or%20hidden%3CBR%20%2F%3E4)%20done%3CBR%20%2F%3E5)%20I%20need%20help%20to%3A%3CBR%20%2F%3Ea)%20get%20hwnd%20in%20start-process%3CBR%20%2F%3Eb)%20set%20its%20window%20size%20to%20a%20minimum%20or%20better%20yet%2C%20hidden%3CBR%20%2F%3Ec)%20send%20keys%20(%25%7BF4%7D)%20or%20better%20yet%2C%20a%20message%20to%20close%20browser%3CBR%20%2F%3E6)%20don%C2%B4t%20know%20if%20it%20works%3CBR%20%2F%3E%3CBR%20%2F%3Eif%20something%20needs%20clarification%2C%20please%20let%20me%20know.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3510830%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3510830%22%20slang%3D%22en-US%22%3EDoes%20it%20really%20need%20to%20open%20the%20browser%3F%3CBR%20%2F%3ECan%20you%20use%20Invoke-WebRequest%20directly%20from%20PowerShell%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.utility%2Finvoke-webrequest%3Fview%3Dpowershell-7.2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.utility%2Finvoke-webrequest%3Fview%3Dpowershell-7.2%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3511045%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3511045%22%20slang%3D%22en-US%22%3Ehi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1307476%22%20target%3D%22_blank%22%3E%40Newbie_Jones%3C%2FA%3E%20it%20looks%20promising...%20I'm%20starting%20to%20think%20I'm%20reinventing%20the%20wheel%20because%20I'm%20a%20rookie%20on%20all%20this%20web%20mumbo-jumbo%3CBR%20%2F%3EI'll%20post%20my%20results%20asap%2C%20thx%20a%20lot.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3522326%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20launch%20a%20browser%20with%20task%20scheduler%20as%20system%20account%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3522326%22%20slang%3D%22en-US%22%3Ehi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1307476%22%20target%3D%22_blank%22%3E%40Newbie_Jones%3C%2FA%3E%20%26amp%3B%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%2C%20I'm%20glad%20to%20report%20that%20Invoke-WebRequest%20did%20the%20job%20as%20a%20charm%20and%20I'm%20about%20to%20finish%20my%20project%2C%20thank%20you%20for%20your%20help!%3C%2FLINGO-BODY%3E
New Contributor

Hi everyone, I hope you can help:

Is it possible to launch a browser,
to open a web page that works in get mode
using powershell on task scheduler,
running as system account to avoid screen updating,
every time any user is logging in,
and then, after the url responds,
close the browser gracefully (other than killing it)?

 

5 Replies
"that works in get mode using powershell on task scheduler" You have to give some more detail, do you wnat to download/invoke something when a user logs in? You can start things at user login, but not as system login...
ok, I know what do I need, but how to do it... I'll try to clarify the scenario:
1) use task scheduler whenever a user logs in, to run powershell minimized or hidden
2) powershell must get some data
3) powershell must launch a browser minimized or hidden
4) browser must point to an url that runs in get mode (https://...?data1&data2...)
5) browser must be terminated gracefully (not being killed or abandoned)
6) use system account to avoid password change issues if possible

Actually, this is what I got:
1) done, except by running minimized or hidden
2) done
3) browser launch done, but not minimized or hidden
4) done
5) I need help to:
a) get hwnd in start-process
b) set its window size to a minimum or better yet, hidden
c) send keys (%{F4}) or better yet, a message to close browser
6) don´t know if it works

if something needs clarification, please let me know.
best response confirmed by oldyguy (New Contributor)
Solution
Does it really need to open the browser?
Can you use Invoke-WebRequest directly from PowerShell?

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?vi...
hi @Newbie_Jones it looks promising... I'm starting to think I'm reinventing the wheel because I'm a rookie on all this web mumbo-jumbo
I'll post my results asap, thx a lot.
hi @Newbie_Jones & @Harm_Veenstra, I'm glad to report that Invoke-WebRequest did the job as a charm and I'm about to finish my project, thank you for your help!