Start browser and auto login

When you need screens in kiosk mode to auto login to Flow Portal

At times you could have a need for some PCs out in the environment (e.g. shop floor) connected to big screens in kiosk mode to present data from Flow Portal. These PCs will likely reboot at times at which you would like them to automatically log on to a Flow Portal tab when they start up.

This little powershell script can help with just that.

$pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
$tempFolder = '--user-data-dir=c:\temp' # pick a temp folder for user data, not always needed
$startmode = '--start-fullscreen' # '--kiosk' is another option
$startPage = 'https://url.to.the.server/client.Portal2/?page=IdOfThePage' #--incognito before the url if desired

Start-Process -FilePath $pathToChrome -ArgumentList $tempFolder, $startmode, $startPage

start-sleep -Milliseconds 5000

[Microsoft.VisualBasic.Interaction]::AppActivate("Chrome")

[System.Windows.Forms.SendKeys]::SendWait("TheUsername{ENTER}")
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("Password{ENTER}")po

What it does is to first set some parameters: Path to the browser - (or other program for that matter) that you would like to start The temp folder - there have been rare cases where this was needed for it to function Start Mode - if you would like it to start in full screen. Same thing as pressing F11 in Chrome Start Page - this is where you provide the full url to the portal and page to open

Then start the program with the above arguments:

Start-Process (with the arguments) start-sleep - It then waits (sleeps) for x millisecond, this to give it time to start the browser AppActivate - activates Crome just to make sure no other programs got the focus in between SendKeys - This will pass the keys as if they were entered by a keyboard. Assuming that the logon window is active it will enter the user name you have in the script followed by Enter. Then just do a small wait again and typing the password in the same way as username followed by Enter again, which would let you in to the desired tab.

Last updated