I did read each and every post in this thread but some info that can be helpful is not in any of them. You are right I do not know xen but I’m just trying to help to get things up and running for you. Nobody told you to Google and nobody called you stupid. Maybe you are just not that experienced in kix scripting. That’s how we all started. Sure you can ask for specific help. Someone may have an answer.

Ok. Let’s get going.
Facts:
  • Clients are locked down and immediately show the virtual desktop logon screen.
  • There is more than one xen server.
  • First six characters of the client name are unique to a specific location.
  • Printers should be set based on the client’s location.

Questions:
  • Do your xen servers have a specific naming layout that can be used to identify them (xenserver01, 02, etc...) or something like it? Maybe they are in a specific IP range or is there anything else specific to the xen servers that can be used to identify them in kix?
  • Is the clientname environment variable available in the virtual desktop session? If so then it might be useful to identify the client and set printers based on the client name. You can use the xd4clientname application but if it is available as an environment var then this is much easier.

Below is an example of what I'm after. It assumes that the name of the servers can be used to identify them but this can be changed if needed. It is pseudo code just to give you an idea. It is not a working script ;\)
 Code:
If InStr(@WKSTA, "XENSERVER")
	Shell @LDRIVE + "\XD4Clientname.exe"	
	$clientname = ExpandEnvironmentVars(%XDClientName%)
	Select
		Case Left($clientname, 6) = "LA-MAN"
			;add printer code for LA-MAN clients here.
		Case Left($clientname, 6) = "CA-DOC"
			;add printer code for CA-DOC clients here.
	EndSelect
Else
	?"Not on a xen server"
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.