You will need to download and save theDefSet utility onto each citrix server available form http://www.ctrl-alt-del.com.au/CAD_Utils.htm. In my case I just saved it to %windir%.
After that you will need to create a Group Policy that will apply to all the Citrix users. In this policy you will need to add the following batch login script. The delay is there to ensure all the printers have been generated before the utility is run.
defset.bat
timeout 20
start %windir%\defset.exe /minThis will in essence work now but any client side printers published to the session will break it. To deal with that we need to make two changes. First off add the following Citrix Policy to the same Group Policy we already created.
Policy: Client printer names
Value: Legacy printer names
Now save the following VBScript onto your Citrix servers where you put DefSet. Any local printer on the server can be used here and it is only needed to get a fixed default printer prior to DefSet running so there there are no errors.
SetDefault.vbs
Set WSHNetwork = CreateObject("WScript.Network")WSHNetwork.SetDefaultPrinter "Adobe PDF"
Next edit the defset.bat file and added the following line before the DefSet code.
cscript.exe %windir%\SetDefault.vbs
Once done when a user loges in first all the printers will be set up by the Citrix Policies and the local shared printers will be configured as well. As that is happening the VBScript will set a fixed printer on the server as the default. After 20 seconds the DefSet tool will launch and restore the users default printer. The DefSet tool stores the preference in the users home directory witch should automatically be backed up and restored fir the Citrix Profile manager.
As a final option you can remove the icon from the system tray and add DefSet as a published application. We like a clean System tray so I also added the following lines to the end of defset.bat to close the system tray icon after a few seconds.
timeout 3taskkill /FI "IMAGENAME eq DEFSET.exe" /FI "USERNAME eq %username%"Please note that changing the default printer must be done with the DefSet tool and changing the printer in Windows will still be ignored on logoff.
0 comments:
Post a Comment