Client Startup Scripting

hostname = system.tag.read("[system]client/Network/Hostname").value
ipaddress = system.tag.read("[System]Client/Network/IPAddress").value
username = system.tag.read("[System]Client/User/Username").value

if username == "guest":
	system.nav.swapTo("Main Windows/Main Menu")
	system.nav.openWindow("Navigation")
else:
	system.nav.swapTo("Main Windows/Main Menu")
	system.nav.openWindow("Navigation")

I understand whats going on here and the concept is basically the same for IP Addresses or Hostname my question is how would you go about saying hey if this IP address opens the client, you go to this certain window but i want it opened as a guest username not admin or anything else.

if username == "guest" and ipaddress == "10.10.20.4": 
	system.nav.swapTo("Main Windows/Main Menu")
	system.nav.openWindow("Navigation")

this code checks for the IP address but now how can i say it to open is for a guest username. now i know you can setup auto login but is the a way to specify what can auto login and what cant. basically I need plant monitors to always login as guest and go straight to a certain window depending on their location. hope I’m not being to confusing.
Thanks as always!!!

perhaps its easier to set auto login as guest for everyone this way i wont have to worry about that and if someone needs to login as an admin then they can just switch users. this would be a easy solution but if guys know how i can use scripting to tell the client to login as guest or admin when i want it, it would be great. thanks

Maybe you could use the system.security.switchUser function to change which user is logged in.

Best,